Skip to content

Commit e1554ac

Browse files
committed
Revert "[InstCombine] Remove side effect of replaced constrained intrinsics"
This reverts commit 83914ee. The change caused discussion: https://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20220502/1034841.html
1 parent 5a4f177 commit e1554ac

File tree

3 files changed

+0
-139
lines changed

3 files changed

+0
-139
lines changed

llvm/include/llvm/Analysis/InstructionSimplify.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -299,10 +299,6 @@ Value *SimplifyBinOp(unsigned Opcode, Value *LHS, Value *RHS, FastMathFlags FMF,
299299
const SimplifyQuery &Q);
300300

301301
/// Given a callsite, fold the result or return null.
302-
///
303-
/// \note A call with declared side effect may be simplified into a value
304-
/// without such. It happens if simplification code deduces that side effect
305-
/// is actually absent.
306302
Value *SimplifyCall(CallBase *Call, const SimplifyQuery &Q);
307303

308304
/// Given an operand for a Freeze, see if we can fold the result.

llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1237,16 +1237,6 @@ Instruction *InstCombinerImpl::visitCallInst(CallInst &CI) {
12371237
return NewCall;
12381238
}
12391239

1240-
// Unused constrained FP intrinsic calls may have declared side effect, which
1241-
// actually absent. If SimplifyCall returns a replacement for such call,
1242-
// assume side effect is absent and the call may be removed.
1243-
if (CI.use_empty() && isa<ConstrainedFPIntrinsic>(CI)) {
1244-
if (SimplifyCall(&CI, SQ.getWithInstruction(&CI))) {
1245-
eraseInstFromFunction(CI);
1246-
return nullptr;
1247-
}
1248-
}
1249-
12501240
Intrinsic::ID IID = II->getIntrinsicID();
12511241
switch (IID) {
12521242
case Intrinsic::objectsize:

llvm/test/Transforms/InstCombine/constrained.ll

Lines changed: 0 additions & 125 deletions
This file was deleted.

0 commit comments

Comments
 (0)