aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/Local.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Transforms/Utils/Local.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/Local.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Utils/Local.cpp b/llvm/lib/Transforms/Utils/Local.cpp
index 3d3b97e..380bac9 100644
--- a/llvm/lib/Transforms/Utils/Local.cpp
+++ b/llvm/lib/Transforms/Utils/Local.cpp
@@ -475,6 +475,12 @@ bool llvm::wouldInstructionBeTriviallyDead(const Instruction *I,
II->getIntrinsicID() == Intrinsic::launder_invariant_group)
return true;
+ // Intrinsics declare sideeffects to prevent them from moving, but they are
+ // nops without users.
+ if (II->getIntrinsicID() == Intrinsic::allow_runtime_check ||
+ II->getIntrinsicID() == Intrinsic::allow_ubsan_check)
+ return true;
+
if (II->isLifetimeStartOrEnd()) {
auto *Arg = II->getArgOperand(1);
// Lifetime intrinsics are dead when their right-hand is undef.