summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorSanjoy Das <sanjoy@playingwithpointers.com>2016-06-08 17:48:36 +0000
committerSanjoy Das <sanjoy@playingwithpointers.com>2016-06-08 17:48:36 +0000
commit9a65cd214d0caef30d0b353701e5a66bf59841e4 (patch)
tree4a3681c38f9bba97a2c75fe5598ef5aff4c8fad6 /llvm/lib
parenta19edc4d15b0dae0210b90615775edd76f021008 (diff)
downloadbcm5719-llvm-9a65cd214d0caef30d0b353701e5a66bf59841e4.tar.gz
bcm5719-llvm-9a65cd214d0caef30d0b353701e5a66bf59841e4.zip
Teach isGuarantdToTransferExecToSuccessor about debug info intrinsics
Calls to `@llvm.dbg.*` can be assumed to terminate. llvm-svn: 272180
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Analysis/ValueTracking.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/llvm/lib/Analysis/ValueTracking.cpp b/llvm/lib/Analysis/ValueTracking.cpp
index d735448f1dd..323fe83bff6 100644
--- a/llvm/lib/Analysis/ValueTracking.cpp
+++ b/llvm/lib/Analysis/ValueTracking.cpp
@@ -3448,10 +3448,13 @@ bool llvm::isGuaranteedToTransferExecutionToSuccessor(const Instruction *I) {
// atomic operations are guaranteed to terminate on most platforms
// and most functions terminate.
+ // Calls can throw and thus not terminate, and invokes may not terminate and
+ // could throw to non-successor (see bug 24185 for details).
+ if (isa<CallInst>(I) || isa<InvokeInst>(I))
+ // However, llvm.dbg intrinsics are safe, since they're no-ops.
+ return isa<DbgInfoIntrinsic>(I);
+
return !I->isAtomic() && // atomics may never succeed on some platforms
- !isa<CallInst>(I) && // could throw and might not terminate
- !isa<InvokeInst>(I) && // might not terminate and could throw to
- // non-successor (see bug 24185 for details).
!isa<ResumeInst>(I) && // has no successors
!isa<ReturnInst>(I); // has no successors
}
OpenPOWER on IntegriCloud