diff options
author | Sander de Smalen <sander.desmalen@arm.com> | 2020-11-04 08:56:54 +0000 |
---|---|---|
committer | Sander de Smalen <sander.desmalen@arm.com> | 2020-11-05 11:02:18 +0000 |
commit | d57bba7cf831aa603d1f060a7a2d4ac55bdacdc9 (patch) | |
tree | 5c93955e5db78e5b29ea492693ec022dcd79a531 /llvm/lib/CodeGen/LiveDebugValues/VarLocBasedImpl.cpp | |
parent | b25765792be35393a9057774a0be2b53b1ff5bf2 (diff) | |
download | llvm-d57bba7cf831aa603d1f060a7a2d4ac55bdacdc9.zip llvm-d57bba7cf831aa603d1f060a7a2d4ac55bdacdc9.tar.gz llvm-d57bba7cf831aa603d1f060a7a2d4ac55bdacdc9.tar.bz2 |
[SVE] Return StackOffset for TargetFrameLowering::getFrameIndexReference.
To accommodate frame layouts that have both fixed and scalable objects
on the stack, describing a stack location or offset using a pointer + uint64_t
is not sufficient. For this reason, we've introduced the StackOffset class,
which models both the fixed- and scalable sized offsets.
The TargetFrameLowering::getFrameIndexReference is made to return a StackOffset,
so that this can be used in other interfaces, such as to eliminate frame indices
in PEI or to emit Debug locations for variables on the stack.
This patch is purely mechanical and doesn't change the behaviour of how
the result of this function is used for fixed-sized offsets. The patch adds
various checks to assert that the offset has no scalable component, as frame
offsets with a scalable component are not yet supported in various places.
Reviewed By: arsenm
Differential Revision: https://reviews.llvm.org/D90018
Diffstat (limited to 'llvm/lib/CodeGen/LiveDebugValues/VarLocBasedImpl.cpp')
-rw-r--r-- | llvm/lib/CodeGen/LiveDebugValues/VarLocBasedImpl.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/LiveDebugValues/VarLocBasedImpl.cpp b/llvm/lib/CodeGen/LiveDebugValues/VarLocBasedImpl.cpp index 8833021..ed7f04e 100644 --- a/llvm/lib/CodeGen/LiveDebugValues/VarLocBasedImpl.cpp +++ b/llvm/lib/CodeGen/LiveDebugValues/VarLocBasedImpl.cpp @@ -983,8 +983,10 @@ VarLocBasedLDV::extractSpillBaseRegAndOffset(const MachineInstr &MI) { int FI = cast<FixedStackPseudoSourceValue>(PVal)->getFrameIndex(); const MachineBasicBlock *MBB = MI.getParent(); Register Reg; - int Offset = TFI->getFrameIndexReference(*MBB->getParent(), FI, Reg); - return {Reg, Offset}; + StackOffset Offset = TFI->getFrameIndexReference(*MBB->getParent(), FI, Reg); + assert(!Offset.getScalable() && + "Frame offsets with a scalable component are not supported"); + return {Reg, static_cast<int>(Offset.getFixed())}; } /// Try to salvage the debug entry value if we encounter a new debug value |