[PATCH] D98716: [NFC][CodeGen] Separate TargetRegisterInfo needsStackRealignment and canRealignStack
Tomas Matheson via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Mar 16 09:09:46 PDT 2021
tmatheson created this revision.
Herald added subscribers: kerbowa, pengfei, hiraditya, nhaehnle, jvesely, arsenm.
tmatheson requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
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:
- Make needsStackRealignment virtual so that backends can override it
- Override needsStackRealignment rather than canRealignStack in SIRegisterInfo
- Update some call sites of needsStackRealignment (where backend tests were failing). Some of these may not be necessary.
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).
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D98716
Files:
llvm/include/llvm/CodeGen/TargetRegisterInfo.h
llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
llvm/lib/CodeGen/GCRootLowering.cpp
llvm/lib/CodeGen/MachineFrameInfo.cpp
llvm/lib/CodeGen/PrologEpilogInserter.cpp
llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
llvm/lib/CodeGen/StackMaps.cpp
llvm/lib/CodeGen/TargetRegisterInfo.cpp
llvm/lib/Target/AMDGPU/SIRegisterInfo.cpp
llvm/lib/Target/AMDGPU/SIRegisterInfo.h
llvm/lib/Target/ARM/ARMBaseRegisterInfo.cpp
llvm/lib/Target/ARM/ARMExpandPseudoInsts.cpp
llvm/lib/Target/ARM/ARMFrameLowering.cpp
llvm/lib/Target/X86/X86FrameLowering.cpp
llvm/lib/Target/X86/X86ISelLowering.cpp
llvm/lib/Target/X86/X86InstrInfo.cpp
llvm/lib/Target/X86/X86RegisterInfo.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D98716.331007.patch
Type: text/x-patch
Size: 23234 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210316/3a89fd2f/attachment.bin>
More information about the llvm-commits
mailing list