You are viewing a plain text version of this content. The canonical link for it is here.
Posted to discuss-archive@tvm.apache.org by "tlopex (via GitHub)" <gi...@apache.org> on 2026/06/10 07:13:31 UTC

[PR] [Codegen][LLVM] Accept splat form in VLA broadcast test [tvm]

tlopex opened a new pull request, #19716:
URL: https://github.com/apache/tvm/pull/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.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: discuss-archive-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: discuss-archive-unsubscribe@tvm.apache.org
For additional commands, e-mail: discuss-archive-help@tvm.apache.org


Re: [PR] [Codegen][LLVM] Accept splat form in VLA broadcast test [tvm]

Posted by "tqchen (via GitHub)" <gi...@apache.org>.
tqchen merged PR #19716:
URL: https://github.com/apache/tvm/pull/19716


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: discuss-archive-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: discuss-archive-unsubscribe@tvm.apache.org
For additional commands, e-mail: discuss-archive-help@tvm.apache.org


Re: [PR] [Codegen][LLVM] Accept splat form in VLA broadcast test [tvm]

Posted by "tqchen (via GitHub)" <gi...@apache.org>.
tqchen commented on PR #19716:
URL: https://github.com/apache/tvm/pull/19716#issuecomment-4669888939

   please adopt gemini reviews


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: discuss-archive-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: discuss-archive-unsubscribe@tvm.apache.org
For additional commands, e-mail: discuss-archive-help@tvm.apache.org


Re: [PR] [Codegen][LLVM] Accept splat form in VLA broadcast test [tvm]

Posted by "gemini-code-assist[bot] (via GitHub)" <gi...@apache.org>.
gemini-code-assist[bot] commented on code in PR #19716:
URL: https://github.com/apache/tvm/pull/19716#discussion_r3386248463


##########
tests/python/codegen/test_target_codegen_llvm_vla.py:
##########
@@ -109,9 +109,13 @@ def my_func(a: T.handle):
         mod = tvm.tirx.build(my_func)
 
     llvm = mod.inspect_source("ll")
+    # Older LLVM versions print the broadcast as a shufflevector of an insertelement,
+    # newer ones print it as a splat constant.
     assert re.findall(
         r"shufflevector \(<vscale x 4 x float> insertelement \(<vscale x 4 x float>", llvm
-    ), "No scalable broadcast in generated LLVM."
+    ) or re.findall(r"store <vscale x 4 x float> splat \(float 1\.000000e\+00\)", llvm), (
+        "No scalable broadcast in generated LLVM."
+    )

Review Comment:
   ![medium](https://www.gstatic.com/codereviewagent/medium-priority.svg)
   
   Since both patterns are literal strings without any dynamic regex patterns (like wildcards or character classes), we can use the Python `in` operator instead of `re.findall`. This is more readable, avoids the need to escape parentheses and dots, and is significantly more efficient.
   
   ```python
       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."
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: discuss-archive-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: discuss-archive-unsubscribe@tvm.apache.org
For additional commands, e-mail: discuss-archive-help@tvm.apache.org