summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp')
-rw-r--r--llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp b/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
index 6b03b682bca..679596766fc 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
@@ -2870,6 +2870,16 @@ Instruction *InstCombiner::visitCallInst(CallInst &CI) {
// TODO: relocate((gep p, C, C2, ...)) -> gep(relocate(p), C, C2, ...)
break;
}
+
+ case Intrinsic::experimental_guard: {
+ Value *IIOperand = II->getArgOperand(0);
+
+ // Remove a guard if it is immediately followed by an identical guard.
+ if (match(II->getNextNode(),
+ m_Intrinsic<Intrinsic::experimental_guard>(m_Specific(IIOperand))))
+ return eraseInstFromFunction(*II);
+ break;
+ }
}
return visitCallSite(II);
OpenPOWER on IntegriCloud