[llvm] [SDAG] Teach FoldConstantArithmetic to match splats inserted into vectors (PR #163984)

Paul Walker via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 21 06:06:56 PDT 2025


================
@@ -8,7 +8,7 @@
 define void @pr35443() {
 ; CHECK-LABEL: pr35443:
 ; CHECK:       # %bb.0: # %entry
-; CHECK-NEXT:    vpbroadcastb ac+4(%rip), %xmm0
+; CHECK-NEXT:    vpbroadcastb ac+4(%rip), %ymm0
----------------
paulwalker-arm wrote:

As this path has proven successful I now think the combine is better done at the IR level.

My ISEL suggestion is more for the next logical step when only the "value inserted into poison" is constant. While we want to preserve the information that only part of the vector has real data, we'll still want to match compatible variants as scalable vector splats during selection to match against the instructions that take an immediate.

https://github.com/llvm/llvm-project/pull/163984


More information about the llvm-commits mailing list