[PATCH] D69936: [IPRA][ARM] Spill extra registers at -Oz

Oliver Stannard (Linaro) via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 7 03:03:56 PST 2019


ostannard created this revision.
ostannard added reviewers: efriedma, sdesmalen, dmgreen.
Herald added subscribers: hiraditya, kristof.beyls, qcolombet.
Herald added a project: LLVM.
ostannard added a parent revision: D69906: [ARM] Track epilogue instructions with FrameDestroy flag (NFC).

When optimising for code size at the expense of performance, it is often
worth saving and restoring some of r0-r3, if IPRA will be able to take
advantage of them. This doesn't cost any extra code size if we already
have a PUSH/POP pair, and increases the number of available registers
across any calls to the function.

We already have an optimisation which tries fold the subtract/add of the
SP into the PUSH/POP by using extra registers, which somewhat conflicts
with this. I've made the new optimisation less aggressive in cases where
the existing one is likely to trigger, which gives better results than
either of these optimisations by themselves.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D69936

Files:
  llvm/include/llvm/CodeGen/MachineRegisterInfo.h
  llvm/lib/CodeGen/MachineRegisterInfo.cpp
  llvm/lib/CodeGen/PrologEpilogInserter.cpp
  llvm/lib/CodeGen/ShrinkWrap.cpp
  llvm/lib/Target/ARM/ARMFrameLowering.cpp
  llvm/lib/Target/ARM/ARMFrameLowering.h
  llvm/lib/Target/ARM/ARMISelLowering.cpp
  llvm/lib/Target/ARM/Thumb1FrameLowering.cpp
  llvm/test/CodeGen/ARM/ipra-extra-spills-shrink-wrapping.mir
  llvm/test/CodeGen/ARM/ipra-extra-spills.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D69936.228199.patch
Type: text/x-patch
Size: 41767 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191107/fef6fe05/attachment.bin>


More information about the llvm-commits mailing list