[llvm] [InstCombine] Pull shuffles out of binops with splatted ops (PR #137948)
Philip Reames via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 30 15:33:19 PDT 2025
================
@@ -2271,6 +2271,27 @@ Instruction *InstCombinerImpl::foldVectorBinop(BinaryOperator &Inst) {
}
}
+ // Similar to the combine above, but handles the case for scalable vectors
+ // where both shuffle(V1, 0) and C are splats.
+ //
+ // Op(shuffle(V1, 0), (splat C)) -> shuffle(Op(V1, (splat C)), 0)
+ if (isa<ScalableVectorType>(Inst.getType()) &&
----------------
preames wrote:
Code structure wise: Remove the scalable vector check, move this *above* the other transform. That way fixed vector splats go through this too, and we have a much higher chance of finding any bugs.
https://github.com/llvm/llvm-project/pull/137948
More information about the llvm-commits
mailing list