[llvm] [InstCombine] Fixup commit 7253c6f (PR #123315)

via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 17 02:14:33 PST 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-llvm-transforms

Author: Sushant Gokhale (sushgokh)

<details>
<summary>Changes</summary>

This should fix the assert failure we were getting for the darwin OS.

---
Full diff: https://github.com/llvm/llvm-project/pull/123315.diff


1 Files Affected:

- (modified) llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp (+1-2) 


``````````diff
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp b/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
index b6acde9bdd1104..df5f9833a2ff92 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
@@ -2067,8 +2067,7 @@ convertFSqrtDivIntoFMul(CallInst *CI, Instruction *X,
   FMul->copyMetadata(*X);
   FMul->copyFastMathFlags(FastMathFlags::intersectRewrite(R1FMF, R2FMF) |
                           FastMathFlags::unionValue(R1FMF, R2FMF));
-  IC->replaceInstUsesWith(*X, FMul);
-  return IC->eraseInstFromFunction(*X);
+  return IC->replaceInstUsesWith(*X, FMul);
 }
 
 Instruction *InstCombinerImpl::visitFDiv(BinaryOperator &I) {

``````````

</details>


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


More information about the llvm-commits mailing list