summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/SimplifyCFG/invoke.ll
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2016-06-25 08:04:19 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2016-06-25 08:04:19 +0000
commitd346a377375a4780c95f4d30150bdeaed1a35b65 (patch)
tree3d072a06308fde37e739c18b40e6da6d57996e42 /llvm/test/Transforms/SimplifyCFG/invoke.ll
parentbb53d23ef8127b0be819b730e5094bd1d4b8e515 (diff)
downloadbcm5719-llvm-d346a377375a4780c95f4d30150bdeaed1a35b65.tar.gz
bcm5719-llvm-d346a377375a4780c95f4d30150bdeaed1a35b65.zip
[SimplifyCFG] Stop inserting calls to llvm.trap for UB
SimplifyCFG had logic to insert calls to llvm.trap for two very particular IR patterns: stores and invokes of undef/null. While InstCombine canonicalizes certain undefined behavior IR patterns to stores of undef, phase ordering means that this cannot be relied upon in general. There are much better tools than llvm.trap: UBSan and ASan. N.B. I could be argued into reverting this change if a clear argument as to why it is important that we synthesize llvm.trap for stores, I'd be hard pressed to see why it'd be useful for invokes... llvm-svn: 273778
Diffstat (limited to 'llvm/test/Transforms/SimplifyCFG/invoke.ll')
-rw-r--r--llvm/test/Transforms/SimplifyCFG/invoke.ll2
1 files changed, 0 insertions, 2 deletions
diff --git a/llvm/test/Transforms/SimplifyCFG/invoke.ll b/llvm/test/Transforms/SimplifyCFG/invoke.ll
index b7fd7d62ccf..506fef0ef92 100644
--- a/llvm/test/Transforms/SimplifyCFG/invoke.ll
+++ b/llvm/test/Transforms/SimplifyCFG/invoke.ll
@@ -12,7 +12,6 @@ declare i32 @fn()
; CHECK-LABEL: @f1(
define i8* @f1() nounwind uwtable ssp personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
entry:
-; CHECK: call void @llvm.trap()
; CHECK: unreachable
%call = invoke noalias i8* undef()
to label %invoke.cont unwind label %lpad
@@ -31,7 +30,6 @@ lpad:
; CHECK-LABEL: @f2(
define i8* @f2() nounwind uwtable ssp personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
entry:
-; CHECK: call void @llvm.trap()
; CHECK: unreachable
%call = invoke noalias i8* null()
to label %invoke.cont unwind label %lpad
OpenPOWER on IntegriCloud