llvm-project/llvm/lib/Target/ARC
Tomas Matheson a9968c0a33 [NFC][CodeGen] Tidy up TargetRegisterInfo stack realignment functions
Currently needsStackRealignment returns false if canRealignStack returns false.
This means that the behavior of needsStackRealignment does not correspond to
it's name and description; a function might need stack realignment, but if it
is not possible then this function returns false. Furthermore,
needsStackRealignment is not virtual and therefore some backends have made use
of canRealignStack to indicate whether a function needs stack realignment.

This patch attempts to clarify the situation by separating them and introducing
new names:

 - shouldRealignStack - true if there is any reason the stack should be
   realigned

 - canRealignStack - true if we are still able to realign the stack (e.g. we
   can still reserve/have reserved a frame pointer)

 - hasStackRealignment = shouldRealignStack && canRealignStack (not target
   customisable)

Targets can now override shouldRealignStack to indicate that stack realignment
is required.

This change will make it easier in a future change to handle the case where we
need to realign the stack but can't do so (for example when the register
allocator creates an aligned spill after the frame pointer has been
eliminated).

Differential Revision: https://reviews.llvm.org/D98716

Change-Id: Ib9a4d21728bf9d08a545b4365418d3ffe1af4d87
2021-03-30 17:31:39 +01:00
..
Disassembler
MCTargetDesc [ARC] Correct ARCInstPrinter::getMnemonic after D90039 2020-11-17 09:08:36 -08:00
TargetInfo
ARC.h
ARC.td
ARCAsmPrinter.cpp
ARCBranchFinalize.cpp
ARCCallingConv.td
ARCExpandPseudos.cpp
ARCFrameLowering.cpp [NFC][CodeGen] Tidy up TargetRegisterInfo stack realignment functions 2021-03-30 17:31:39 +01:00
ARCFrameLowering.h
ARCISelDAGToDAG.cpp
ARCISelLowering.cpp
ARCISelLowering.h
ARCInstrFormats.td
ARCInstrInfo.cpp
ARCInstrInfo.h
ARCInstrInfo.td
ARCMCInstLower.cpp
ARCMCInstLower.h
ARCMachineFunctionInfo.cpp
ARCMachineFunctionInfo.h
ARCOptAddrMode.cpp
ARCRegisterInfo.cpp
ARCRegisterInfo.h
ARCRegisterInfo.td Support a list of CostPerUse values 2021-01-29 10:14:52 +05:30
ARCSubtarget.cpp
ARCSubtarget.h
ARCTargetMachine.cpp [llvm] Use Optional::getValueOr (NFC) 2021-01-12 21:43:50 -08:00
ARCTargetMachine.h
ARCTargetStreamer.h
ARCTargetTransformInfo.h
CMakeLists.txt