[llvm] [InstSimplify] Make sure the simplified value doesn't generate poison in threadBinOpOverSelect (PR #87075)

via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 29 09:54:32 PDT 2024


================
@@ -440,7 +440,8 @@ static Value *threadBinOpOverSelect(Instruction::BinaryOps Opcode, Value *LHS,
     // Check that the simplified value has the form "X op Y" where "op" is the
     // same as the original operation.
     Instruction *Simplified = dyn_cast<Instruction>(FV ? FV : TV);
-    if (Simplified && Simplified->getOpcode() == unsigned(Opcode)) {
+    if (Simplified && Simplified->getOpcode() == unsigned(Opcode) &&
+        !Simplified->hasPoisonGeneratingFlags()) {
----------------
goldsteinn wrote:

Shouldn't `isSafeToSpeculativelyExecute` suffice here?

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


More information about the llvm-commits mailing list