[llvm] [InstCombine] Pull shuffles out of binops with splatted ops (PR #137948)

Yingwei Zheng via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 30 05:14:00 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 V1 and C are splats.
----------------
dtcxzyw wrote:

```suggestion
  // where both shuffle(V1, 0) and C are splats.
```
`V1` is not required to be a splat vector.


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


More information about the llvm-commits mailing list