This is an automated email from the ASF dual-hosted git repository.

tqchen pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tvm.git


The following commit(s) were added to refs/heads/main by this push:
     new e214468919 [Codegen][LLVM] Accept splat form in VLA broadcast test 
(#19716)
e214468919 is described below

commit e21446891943f1726ed21ae06cbfe6605cfb43b5
Author: Shushi Hong <[email protected]>
AuthorDate: Wed Jun 10 11:19:37 2026 -0400

    [Codegen][LLVM] Accept splat form in VLA broadcast test (#19716)
    
    Newer LLVM versions (observed with LLVM 20) print a scalable broadcast
    store as a splat constant, e.g.
    `store <vscale x 4 x float> splat (float 1.000000e+00)`, instead of the
    older `shufflevector (<vscale x 4 x float> insertelement (...` form.
    Accept either representation in test_scalable_broadcast so the test
    passes across LLVM versions while still verifying scalable vector
    codegen.
    
    ---------
    
    Co-authored-by: tqchen <[email protected]>
---
 tests/python/codegen/test_target_codegen_llvm_vla.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/tests/python/codegen/test_target_codegen_llvm_vla.py 
b/tests/python/codegen/test_target_codegen_llvm_vla.py
index 16514af9c6..20efd54bdd 100644
--- a/tests/python/codegen/test_target_codegen_llvm_vla.py
+++ b/tests/python/codegen/test_target_codegen_llvm_vla.py
@@ -109,8 +109,11 @@ def test_scalable_broadcast(target):
         mod = tvm.tirx.build(my_func)
 
     llvm = mod.inspect_source("ll")
-    assert re.findall(
-        r"shufflevector \(<vscale x 4 x float> insertelement \(<vscale x 4 x 
float>", llvm
+    # Older LLVM versions print the broadcast as a shufflevector of an 
insertelement,
+    # newer ones print it as a splat constant.
+    assert (
+        "shufflevector (<vscale x 4 x float> insertelement (<vscale x 4 x 
float>" in llvm
+        or "store <vscale x 4 x float> splat (float 1.000000e+00)" in llvm
     ), "No scalable broadcast in generated LLVM."
     assert re.findall(r" store <vscale x 4 x float>", llvm), "No scalable 
store in generated LLVM."
 

Reply via email to