[PATCH] D67868: [GlobalISel] Defer setting HasCalls on MachineFrameInfo to selection time.

Amara Emerson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 20 15:59:51 PDT 2019


aemerson created this revision.
aemerson added reviewers: paquette, arsenm.
Herald added subscribers: Petar.Avramovic, volkan, hiraditya, rovka, wdng.
Herald added a project: LLVM.

We currently always set the HasCalls on MFI during translation and legalization if we're handling a call or legalizing to a libcall. However, if that call is later optimized to a tail call then we don't need the flag. The flag being set to true causes frame lowering to always save and restore FP/LR, which adds unnecessary code.

This change does the same thing as SelectionDAG and ports over some code that scans instructions after selection, using TargetInstrInfo to determine if target opcodes are known calls.

Code size geomean improvements on CTMark:
 -O0 : 0.1%
 -Os : 0.3%


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D67868

Files:
  llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp
  llvm/lib/CodeGen/GlobalISel/InstructionSelect.cpp
  llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp
  llvm/test/CodeGen/AArch64/GlobalISel/call-translator.ll
  llvm/test/CodeGen/AArch64/GlobalISel/tail-call-no-save-fp-lr.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D67868.221130.patch
Type: text/x-patch
Size: 4347 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190920/db6662ca/attachment.bin>


More information about the llvm-commits mailing list