diff options
author | Sanjoy Das <sanjoy@playingwithpointers.com> | 2015-06-30 21:22:32 +0000 |
---|---|---|
committer | Sanjoy Das <sanjoy@playingwithpointers.com> | 2015-06-30 21:22:32 +0000 |
commit | 9c41a93e24880289837cb387dc78dc643edc9ec6 (patch) | |
tree | a03059fd480e461d157d000e66280c8431d09420 /llvm/lib/CodeGen/ImplicitNullChecks.cpp | |
parent | 2b00f08620d99e49734a9cae8c14461912afbc47 (diff) | |
download | bcm5719-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.cpp | 7 |
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)) |