[all-commits] [llvm/llvm-project] 73cea8: [IPRA][ARM] Spill extra registers at -Oz

ostannard via All-commits all-commits at lists.llvm.org
Wed Mar 18 06:51:23 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 73cea83a6f5ab521edf3cccfc603534776d691ec
      https://github.com/llvm/llvm-project/commit/73cea83a6f5ab521edf3cccfc603534776d691ec
  Author: Oliver Stannard <oliver.stannard at linaro.org>
  Date:   2020-03-18 (Wed, 18 Mar 2020)

  Changed paths:
    M llvm/include/llvm/CodeGen/MachineRegisterInfo.h
    M llvm/lib/CodeGen/MachineRegisterInfo.cpp
    M llvm/lib/CodeGen/PrologEpilogInserter.cpp
    M llvm/lib/Target/ARM/ARMFrameLowering.cpp
    M llvm/lib/Target/ARM/ARMFrameLowering.h
    M llvm/lib/Target/ARM/ARMISelLowering.cpp
    M llvm/lib/Target/ARM/Thumb1FrameLowering.cpp
    A llvm/test/CodeGen/ARM/ipra-extra-spills-exceptions.ll
    A llvm/test/CodeGen/ARM/ipra-extra-spills.ll
    M llvm/test/CodeGen/Thumb2/ifcvt-minsize.ll

  Log Message:
  -----------
  [IPRA][ARM] Spill extra registers at -Oz

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.

Differential revision: https://reviews.llvm.org/D69936




More information about the All-commits mailing list