[clang] [llvm] [InstCombine] Canonicalise Zero Vector operand to always be RHS of a shuffle vector (PR #237258)
Kieran B via cfe-commits
cfe-commits at lists.llvm.org
Mon Nov 9 02:39:48 PST 2026
================
@@ -3068,6 +3070,13 @@ Instruction *InstCombinerImpl::visitShuffleVectorInst(ShuffleVectorInst &SVI) {
return &SVI;
}
+ // shuffle ZeroVec, x, mask --> shuffle x, ZeroVec, mask'
----------------
kieroxide wrote:
Instead of guarding against the infinite loop, we could reduce the scope of this patch to perform the commute only when we insert into lane zero from the non-zero vector. This will reduce the scope of the patch but will allow us to remove the infinite loop guard above
https://github.com/llvm/llvm-project/pull/237258
More information about the cfe-commits
mailing list