summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/ImplicitNullChecks.cpp
diff options
context:
space:
mode:
authorSanjoy Das <sanjoy@playingwithpointers.com>2015-06-30 21:22:32 +0000
committerSanjoy Das <sanjoy@playingwithpointers.com>2015-06-30 21:22:32 +0000
commit9c41a93e24880289837cb387dc78dc643edc9ec6 (patch)
treea03059fd480e461d157d000e66280c8431d09420 /llvm/lib/CodeGen/ImplicitNullChecks.cpp
parent2b00f08620d99e49734a9cae8c14461912afbc47 (diff)
downloadbcm5719-llvm-9c41a93e24880289837cb387dc78dc643edc9ec6.tar.gz
bcm5719-llvm-9c41a93e24880289837cb387dc78dc643edc9ec6.zip
[FaultMaps] Let the frontend pre-select implicit null check candidates.
Summary: This change introduces a !make.implicit metadata that allows the frontend to pre-select the set of explicit null checks that will be considered for transformation into implicit null checks. The reason for not using profiling data instead of !make.implicit is explained in the change to `FaultMaps.rst`. Reviewers: atrick, reames, pgavlin, JosephTremoulet Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D10824 llvm-svn: 241116
Diffstat (limited to 'llvm/lib/CodeGen/ImplicitNullChecks.cpp')
-rw-r--r--llvm/lib/CodeGen/ImplicitNullChecks.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/ImplicitNullChecks.cpp b/llvm/lib/CodeGen/ImplicitNullChecks.cpp
index d7644a6676c..a02cd67ac64 100644
--- a/llvm/lib/CodeGen/ImplicitNullChecks.cpp
+++ b/llvm/lib/CodeGen/ImplicitNullChecks.cpp
@@ -124,6 +124,13 @@ bool ImplicitNullChecks::analyzeBlockForNullChecks(
MachineBasicBlock &MBB, SmallVectorImpl<NullCheck> &NullCheckList) {
typedef TargetInstrInfo::MachineBranchPredicate MachineBranchPredicate;
+ MDNode *BranchMD =
+ MBB.getBasicBlock()
+ ? MBB.getBasicBlock()->getTerminator()->getMetadata("make.implicit")
+ : nullptr;
+ if (!BranchMD)
+ return false;
+
MachineBranchPredicate MBP;
if (TII->AnalyzeBranchPredicate(MBB, MBP, true))
OpenPOWER on IntegriCloud