llvm-project/llvm/lib/Target/Lanai
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
..
AsmParser llvmbuildectomy - replace llvm-build by plain cmake 2020-11-13 10:35:24 +01:00
Disassembler llvmbuildectomy - replace llvm-build by plain cmake 2020-11-13 10:35:24 +01:00
MCTargetDesc [AsmWriter] Factor out mnemonic generation to accessible getMnemonic. 2020-11-17 09:47:38 +00:00
TargetInfo llvmbuildectomy - replace llvm-build by plain cmake 2020-11-13 10:35:24 +01:00
CMakeLists.txt llvmbuildectomy - replace llvm-build by plain cmake 2020-11-13 10:35:24 +01:00
Lanai.h
Lanai.td
LanaiAluCode.h
LanaiAsmPrinter.cpp
LanaiCallingConv.td
LanaiCondCode.h
LanaiDelaySlotFiller.cpp
LanaiFrameLowering.cpp [NFC][CodeGen] Tidy up TargetRegisterInfo stack realignment functions 2021-03-30 17:31:39 +01:00
LanaiFrameLowering.h
LanaiISelDAGToDAG.cpp
LanaiISelLowering.cpp [KnownBits] Add KnownBits::commonBits helper. NFCI. 2020-11-11 12:15:54 +00:00
LanaiISelLowering.h
LanaiInstrFormats.td
LanaiInstrInfo.cpp
LanaiInstrInfo.h
LanaiInstrInfo.td
LanaiMCInstLower.cpp
LanaiMCInstLower.h
LanaiMachineFunctionInfo.cpp
LanaiMachineFunctionInfo.h
LanaiMemAluCombiner.cpp
LanaiRegisterInfo.cpp [NFC][CodeGen] Tidy up TargetRegisterInfo stack realignment functions 2021-03-30 17:31:39 +01:00
LanaiRegisterInfo.h
LanaiRegisterInfo.td
LanaiSchedule.td
LanaiSelectionDAGInfo.cpp
LanaiSelectionDAGInfo.h
LanaiSubtarget.cpp
LanaiSubtarget.h
LanaiTargetMachine.cpp [llvm] Use Optional::getValueOr (NFC) 2021-01-12 21:43:50 -08:00
LanaiTargetMachine.h
LanaiTargetObjectFile.cpp
LanaiTargetObjectFile.h
LanaiTargetTransformInfo.h