[llvm] [InstCombine] Don't cover up poison elements for shifts when folding shuffles thru binops (PR #141303)

Yingwei Zheng via llvm-commits llvm-commits at lists.llvm.org
Sat May 24 00:06:05 PDT 2025


================
@@ -2260,8 +2260,7 @@ Instruction *InstCombinerImpl::foldVectorBinop(BinaryOperator &Inst) {
       // It may not be safe to execute a binop on a vector with poison elements
       // because the entire instruction can be folded to undef or create poison
       // that did not exist in the original code.
-      // TODO: The shift case should not be necessary.
-      if (Inst.isIntDivRem() || (Inst.isShift() && ConstOp1))
+      if (Inst.isIntDivRem())
----------------
dtcxzyw wrote:

The comment above is outdated.
See also https://github.com/llvm/llvm-project/commit/7cd32419ab0ac5ff9609fcff12657b1ac6554e76


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


More information about the llvm-commits mailing list