From e79bb8731ae9089f0635e5634883267a091e318d Mon Sep 17 00:00:00 2001 From: Sushant Gokhale Date: Fri, 17 Jan 2025 02:14:04 -0800 Subject: [PATCH] [InstCombine] Fixup commit 7253c6f (#123315) This should fix the assert failure we were getting for the darwin OS. --- llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp b/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp index b6acde9bdd11047..df5f9833a2ff920 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) {