[PATCH] D49459: [ARM] Avoid spilling lr with Thumb1 tail calls.

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 17 16:49:08 PDT 2018


efriedma created this revision.
efriedma added reviewers: chill, rengolin.
Herald added a reviewer: javed.absar.
Herald added subscribers: chrib, kristof.beyls.

Normally, if any registers are spilled, we prefer to spill lr on Thumb1 so we can fold the "bx lr" into the "pop".  However, if there are tail calls involved, restoring lr is expensive, so skip the optimization in that case.

The spill of r7 in the new test also isn't necessary, but that's mostly orthogonal to this patch. (It's the same code in ARMFrameLowering, but it's not related to tail calls.)


Repository:
  rL LLVM

https://reviews.llvm.org/D49459

Files:
  lib/Target/ARM/ARMFrameLowering.cpp
  test/CodeGen/ARM/v8m-tail-call.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D49459.155990.patch
Type: text/x-patch
Size: 9143 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180717/b41f0afd/attachment.bin>


More information about the llvm-commits mailing list