[AArch64][GlobalISel] Always fall back on tail calls with -tailcallopt
authorJessica Paquette <jpaquette@apple.com>
Fri, 6 Sep 2019 16:49:13 +0000 (16:49 +0000)
committerJessica Paquette <jpaquette@apple.com>
Fri, 6 Sep 2019 16:49:13 +0000 (16:49 +0000)
commit121d9114f5676f676095d5d6f1988abe870549c3
tree78e3a4af3e396b56eaaa1c25b543fdaf95141169
parent454e40eaf328fe34cda7f24d33a1f47060b5ee1a
[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
llvm/lib/Target/AArch64/AArch64CallLowering.cpp
llvm/test/CodeGen/AArch64/tail-call.ll