summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJessica Paquette <jpaquette@apple.com>2018-11-13 23:41:31 +0000
committerJessica Paquette <jpaquette@apple.com>2018-11-13 23:41:31 +0000
commit4e97ec94d9c13b14e76d3377b27c798436326737 (patch)
tree32977ae2a4ed995cbd403f8297c826d3c4a15df7
parenta77eae96bfc8348d11fc58c0aed098259c1905a3 (diff)
downloadbcm5719-llvm-4e97ec94d9c13b14e76d3377b27c798436326737.tar.gz
bcm5719-llvm-4e97ec94d9c13b14e76d3377b27c798436326737.zip
[MachineOutliner][NFC] Use flags set in all candidates to check for calls
If we keep track of if the ContainsCalls bit is set in the MBB flags for each candidate, then we have a better chance of not checking the candidate for calls at all. This saves quite a few checks in some CTMark tests (~200 in Bullet, for example.) llvm-svn: 346816
-rw-r--r--llvm/lib/Target/AArch64/AArch64InstrInfo.cpp17
1 files changed, 11 insertions, 6 deletions
diff --git a/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp b/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
index 219dd4ddf5a..6a47f705c9a 100644
--- a/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
+++ b/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
@@ -5135,10 +5135,16 @@ AArch64InstrInfo::getOutliningCandidateInfo(
return Sum + getInstSizeInBytes(MI);
});
- // Compute liveness information for each candidate.
+ // Properties about candidate MBBs that hold for all of them.
+ unsigned FlagsSetInAll = 0xF;
+
+ // Compute liveness information for each candidate, and set FlagsSetInAll.
const TargetRegisterInfo &TRI = getRegisterInfo();
std::for_each(RepeatedSequenceLocs.begin(), RepeatedSequenceLocs.end(),
- [&TRI](outliner::Candidate &C) { C.initLRU(TRI); });
+ [&TRI, &FlagsSetInAll](outliner::Candidate &C) {
+ FlagsSetInAll &= C.Flags;
+ C.initLRU(TRI);
+ });
// According to the AArch64 Procedure Call Standard, the following are
// undefined on entry/exit from a function call:
@@ -5240,10 +5246,9 @@ AArch64InstrInfo::getOutliningCandidateInfo(
}
}
- // If the MBB containing the first candidate has calls, then it's possible
- // that we have calls in the candidate. If there are no calls, then there's
- // no way that any candidate could have any calls.
- if (FirstCand.Flags & MachineOutlinerMBBFlags::HasCalls) {
+ // Does every candidate's MBB contain a call? If so, then we might have a call
+ // in the range.
+ if (FlagsSetInAll & MachineOutlinerMBBFlags::HasCalls) {
// Check if the range contains a call. These require a save + restore of the
// link register.
if (std::any_of(FirstCand.front(), FirstCand.back(),
OpenPOWER on IntegriCloud