Skip to content

Commit 4038974

Browse files
committed
[InstCombine] Return FRem, as opposed to substituteInParent.
This attempts to fix the ASan buildbot, which is detecting that CI is used after it is removed in substituteInParent. The idea was to make sure it was removed even if it had side-effects writing errno, but that appears to happen if we return FRem directly as usual.
1 parent ffcff2f commit 4038974

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2820,7 +2820,7 @@ Value *LibCallSimplifier::optimizeFMod(CallInst *CI, IRBuilderBase &B) {
28202820
Value *FRem = B.CreateFRemFMF(CI->getOperand(0), CI->getOperand(1), CI);
28212821
if (auto *FRemI = dyn_cast<Instruction>(FRem))
28222822
FRemI->setHasNoNaNs(true);
2823-
substituteInParent(CI, FRem);
2823+
return FRem;
28242824
}
28252825
return nullptr;
28262826
}

0 commit comments

Comments
 (0)