summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorJessica Paquette <jpaquette@apple.com>2019-09-06 16:49:13 +0000
committerJessica Paquette <jpaquette@apple.com>2019-09-06 16:49:13 +0000
commit121d9114f5676f676095d5d6f1988abe870549c3 (patch)
tree78e3a4af3e396b56eaaa1c25b543fdaf95141169 /llvm/lib
parent454e40eaf328fe34cda7f24d33a1f47060b5ee1a (diff)
downloadbcm5719-llvm-121d9114f5676f676095d5d6f1988abe870549c3.tar.gz
bcm5719-llvm-121d9114f5676f676095d5d6f1988abe870549c3.zip
[AArch64][GlobalISel] Always fall back on tail calls with -tailcallopt
-tailcallopt requires that we perform different stack adjustments than with sibling calls. For example, the `@caller_to0_from8` function in test/CodeGen/AArch64/tail-call.ll requires that we adjust SP. Without -tailcallopt, this adjustment does not happen. With it, however, it is expected. So, to ensure that adding sibling call support doesn't break -tailcallopt, make CallLowering always fall back on possible tail calls when -tailcallopt is passed in. Update test/CodeGen/AArch64/tail-call.ll with a GlobalISel line to make sure that we don't differ from the SDAG implementation at any point. Differential Revision: https://reviews.llvm.org/D67245 llvm-svn: 371227
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/AArch64/AArch64CallLowering.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/Target/AArch64/AArch64CallLowering.cpp b/llvm/lib/Target/AArch64/AArch64CallLowering.cpp
index e97b329985a..ffca0e76b6d 100644
--- a/llvm/lib/Target/AArch64/AArch64CallLowering.cpp
+++ b/llvm/lib/Target/AArch64/AArch64CallLowering.cpp
@@ -567,6 +567,12 @@ bool AArch64CallLowering::lowerCall(MachineIRBuilder &MIRBuilder,
return false;
}
+ if (Info.IsTailCall && MF.getTarget().Options.GuaranteedTailCallOpt) {
+ // TODO: Until we lower all tail calls, we should fall back on this.
+ LLVM_DEBUG(dbgs() << "Cannot handle -tailcallopt yet.\n");
+ return false;
+ }
+
SmallVector<ArgInfo, 8> SplitArgs;
for (auto &OrigArg : Info.OrigArgs) {
splitToValueTypes(OrigArg, SplitArgs, DL, MRI, Info.CallConv);
OpenPOWER on IntegriCloud