[PATCH] D70591: [ARM] Allow Usage of R4-R5 as Global Register Variables for ARM

Anna Welker via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 22 03:40:51 PST 2019


anwel created this revision.
anwel added reviewers: carwil, amilendra_arm, phosek, michaelplatings, efriedma.
anwel added projects: LLVM, clang.
Herald added subscribers: llvm-commits, hiraditya, kristof.beyls, srhines, qcolombet.

This patch is an extension of an earlier patch introducing support for r6-r11 (https://reviews.llvm.org/D68862). Here we replace the former hard-coded use of r4 as a scratch register in some parts of the ARM backend, and deal with the cases where r4 and r5 are used as input registers to segmented stack routines (e.g. __chkstk).

Reserving r4 or r5 with segmented stacks is realized by temporarily storing the contents of these registers in free scratch registers, so is subject to a small performance impact (i.e., two additional mov instructions per register). This is only supported on targets where ARMv6 instructions are available.


https://reviews.llvm.org/D70591

Files:
  clang/docs/ClangCommandLineReference.rst
  clang/include/clang/Driver/Options.td
  clang/lib/Driver/ToolChains/Arch/ARM.cpp
  llvm/lib/Target/ARM/ARM.td
  llvm/lib/Target/ARM/ARMFrameLowering.cpp
  llvm/lib/Target/ARM/ARMFrameLowering.h
  llvm/lib/Target/ARM/ARMISelLowering.cpp
  llvm/lib/Target/ARM/ARMISelLowering.h
  llvm/lib/Target/ARM/ARMTargetTransformInfo.h
  llvm/lib/Target/ARM/Thumb1FrameLowering.cpp
  llvm/lib/Target/ARM/Thumb1FrameLowering.h
  llvm/test/CodeGen/ARM/Windows/chkstk-fixed-r4.ll
  llvm/test/CodeGen/ARM/Windows/vla-fixed-r4.ll
  llvm/test/CodeGen/ARM/named-reg-alloc.ll
  llvm/test/CodeGen/ARM/reg-alloc-no-alignment.ll
  llvm/test/CodeGen/ARM/reg-alloc-with-fixed-reg-r4-r5-r6.ll
  llvm/test/CodeGen/ARM/reg-alloc-with-fixed-reg-r5-r6.ll
  llvm/test/CodeGen/ARM/reg-alloc-with-fixed-reg-r5.ll
  llvm/test/CodeGen/ARM/reg-allog-with-fixed-reg-r4.ll
  llvm/test/CodeGen/ARM/segmented-stacks-fixed-r4-r5.ll
  llvm/test/CodeGen/Thumb/callee_save_reserved.ll
  llvm/test/CodeGen/Thumb/emergency-spill-slot.ll
  llvm/test/CodeGen/Thumb2/segmented-stacks-fixed-r4.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D70591.230624.patch
Type: text/x-patch
Size: 65147 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191122/a3a481d5/attachment.bin>


More information about the llvm-commits mailing list