summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Utils/LoopSimplify.cpp
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/lib/Transforms/Utils/LoopSimplify.cpp
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/lib/Transforms/Utils/LoopSimplify.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/LoopSimplify.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Utils/LoopSimplify.cpp b/llvm/lib/Transforms/Utils/LoopSimplify.cpp
index 2509b0a058f..a2dd581f45c 100644
--- a/llvm/lib/Transforms/Utils/LoopSimplify.cpp
+++ b/llvm/lib/Transforms/Utils/LoopSimplify.cpp
@@ -491,7 +491,7 @@ ReprocessLoop:
// Zap the dead pred's terminator and replace it with unreachable.
TerminatorInst *TI = P->getTerminator();
- changeToUnreachable(TI, /*UseLLVMTrap=*/false);
+ changeToUnreachable(TI);
Changed = true;
}
}
OpenPOWER on IntegriCloud