summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/TargetSubtargetInfo.cpp
diff options
context:
space:
mode:
authorMatthias Braun <matze@braunis.de>2018-01-10 18:16:24 +0000
committerMatthias Braun <matze@braunis.de>2018-01-10 18:16:24 +0000
commitb42ffa1283ae56a76e6821595db92c0fd7bc8d78 (patch)
tree00ab39c483b14ac9461da2d5a390e76d7cd865e2 /llvm/lib/CodeGen/TargetSubtargetInfo.cpp
parent95558392282edc563ed07b89c948c9627cf555d5 (diff)
downloadbcm5719-llvm-b42ffa1283ae56a76e6821595db92c0fd7bc8d78.tar.gz
bcm5719-llvm-b42ffa1283ae56a76e6821595db92c0fd7bc8d78.zip
AArch64: Fix emergency spillslot being out of reach for large callframes
Large callframes (calls with several hundreds or thousands or parameters) could lead to situations in which the emergency spillslot is out of range to be addressed relative to the stack pointer. This commit forces the use of a frame pointer in the presence of large callframes. This commit does several things: - Compute max callframe size at the end of instruction selection. - Add mirFileLoaded target callback. Use it to compute the max callframe size after loading a .mir file when the size wasn't specified in the file. - Let TargetFrameLowering::hasFP() return true if there exists a callframe > 255 bytes. - Always place the emergency spillslot close to FP if we have a frame pointer. - Note that `useFPForScavengingIndex()` would previously return false when a base pointer was available leading to the emergency spillslot getting allocated late (that's the whole effect of this callback). Which made no sense to me so I took this case out: Even though the emergency spillslot is technically not referenced by FP in this case we still want it allocated early. Differential Revision: https://reviews.llvm.org/D40876 llvm-svn: 322200
Diffstat (limited to 'llvm/lib/CodeGen/TargetSubtargetInfo.cpp')
-rw-r--r--llvm/lib/CodeGen/TargetSubtargetInfo.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/TargetSubtargetInfo.cpp b/llvm/lib/CodeGen/TargetSubtargetInfo.cpp
index 1a317cd865f..7aab869f025 100644
--- a/llvm/lib/CodeGen/TargetSubtargetInfo.cpp
+++ b/llvm/lib/CodeGen/TargetSubtargetInfo.cpp
@@ -111,3 +111,6 @@ std::string TargetSubtargetInfo::getSchedInfoStr(MCInst const &MCI) const {
TSchedModel.computeInstrRThroughput(MCI.getOpcode());
return createSchedInfoStr(Latency, RThroughput);
}
+
+void TargetSubtargetInfo::mirFileLoaded(MachineFunction &MF) const {
+}
OpenPOWER on IntegriCloud