[PATCH] D118426: [InstCombine] Remove side effect of replaced constrained intrinsics
Eli Friedman via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon May 2 10:25:12 PDT 2022
efriedma added inline comments.
================
Comment at: llvm/include/llvm/Analysis/InstructionSimplify.h:305
+/// without such. It happens if simplification code deduces that side effect
+/// actually absents.
Value *SimplifyCall(CallBase *Call, const SimplifyQuery &Q);
----------------
"is actually absent".
================
Comment at: llvm/lib/Transforms/InstCombine/InstructionCombining.cpp:4134
+ // was found for it, assume that side effect is actually absent and
+ // the instruction can be removed.
+ isa<ConstrainedFPIntrinsic>(I)) {
----------------
It's not clear to me this is the only reason a constrained FP intrinsic can be returned. And even if it were, it's a fragile invariant.
Would it make sense to just have isInstructionTriviallyDead() do the right thing here? We already do something similar with isMathLibCallNoop().
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D118426/new/
https://reviews.llvm.org/D118426
More information about the llvm-commits
mailing list