[llvm] [InstCombine] Do not use operand info in `replaceInInstruction` (PR #99492)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 18 06:59:02 PDT 2024


================
@@ -1248,9 +1248,18 @@ bool InstCombinerImpl::replaceInInstruction(Value *V, Value *Old, Value *New,
     return false;
 
   auto *I = dyn_cast<Instruction>(V);
-  if (!I || !I->hasOneUse() || !isSafeToSpeculativelyExecute(I))
+  if (!I || !I->hasOneUse() || !isSafeToSpeculativelyExecuteWithoutInstrInfo(I))
     return false;
 
+  // Special handling for replacing called operand
+  if (auto *Call = dyn_cast<CallInst>(I)) {
----------------
nikic wrote:

I'd rather not have this special case. Can we limit isSafeToSpeculativelyExecute to only intrinsics if !UseInstrInfo? I don't think we really care about the generic case here.

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


More information about the llvm-commits mailing list