aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineFunction.cpp
diff options
context:
space:
mode:
authorTomas Matheson <tomas.matheson@arm.com>2021-04-20 19:03:09 +0100
committerTomas Matheson <tomas.matheson@arm.com>2021-06-11 16:49:12 +0100
commit773771ba382b1fbcf6acccc0046bfe731541a599 (patch)
tree4953cdb903784a81250250fbb828963f28cc4bec /llvm/lib/CodeGen/MachineFunction.cpp
parenta010d4230e13790b6ff7d2b8f49d478185489fb4 (diff)
downloadllvm-773771ba382b1fbcf6acccc0046bfe731541a599.zip
llvm-773771ba382b1fbcf6acccc0046bfe731541a599.tar.gz
llvm-773771ba382b1fbcf6acccc0046bfe731541a599.tar.bz2
[CodeGen][regalloc] Don't align stack slots if the stack can't be realigned
Register allocation may spill virtual registers to the stack, which can increase alignment requirements of the stack frame. If the the function did not require stack realignment before register allocation, the registers required to do so may not be reserved/available. This results in a stack frame that requires realignment but can not be realigned. Instead, only increase the alignment of the stack if we are still able to realign. The register SpillAlignment will be ignored if we can't realign, and the backend will be responsible for emitting the correct unaligned loads and stores. This seems to be the assumed behaviour already, e.g. ARMBaseInstrInfo::storeRegToStackSlot and X86InstrInfo::storeRegToStackSlot are both `canRealignStack` aware. Differential Revision: https://reviews.llvm.org/D103602
Diffstat (limited to 'llvm/lib/CodeGen/MachineFunction.cpp')
0 files changed, 0 insertions, 0 deletions