summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJessica Paquette <jpaquette@apple.com>2018-12-04 00:31:47 +0000
committerJessica Paquette <jpaquette@apple.com>2018-12-04 00:31:47 +0000
commit2f5833ecd9aca404082113e9bde1e46351442a00 (patch)
tree97e0a282cf4d3975c2028396c74ca8d9f9fecd15
parent23c48c282307ba3bdea1ca4ed94bc069fa108656 (diff)
downloadbcm5719-llvm-2f5833ecd9aca404082113e9bde1e46351442a00.tar.gz
bcm5719-llvm-2f5833ecd9aca404082113e9bde1e46351442a00.zip
[MachineOutliner][AArch64][NFC] Add early exit to candidate discarding logic
If we dropped too many candidates to be beneficial when dropping candidates that modify the stack, there's no reason to check for other cost model qualities. llvm-svn: 348219
-rw-r--r--llvm/lib/Target/AArch64/AArch64InstrInfo.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp b/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
index 56f38aca500..7d83ec9d1db 100644
--- a/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
+++ b/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
@@ -5214,6 +5214,12 @@ AArch64InstrInfo::getOutliningCandidateInfo(
} else {
SetCandidateCallInfo(MachineOutlinerDefault, 12);
}
+
+ // If we dropped all of the candidates, bail out here.
+ if (RepeatedSequenceLocs.size() < 2) {
+ RepeatedSequenceLocs.clear();
+ return outliner::OutlinedFunction();
+ }
}
// Does every candidate's MBB contain a call? If so, then we might have a call
OpenPOWER on IntegriCloud