Lines Matching +full:align +full:- +full:size
1 //===-- MachineFrameInfo.cpp ---------------------------------------------===//
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
11 //===----------------------------------------------------------------------===//
22 #include "llvm/Config/llvm-config.h"
31 void MachineFrameInfo::ensureMaxAlignment(Align Alignment) {
40 static inline Align clampStackAlignment(bool ShouldClamp, Align Alignment,
41 Align StackAlignment) {
51 int MachineFrameInfo::CreateStackObject(uint64_t Size, Align Alignment,
55 assert(Size != 0 && "Cannot allocate zero size stack objects!");
57 Objects.push_back(StackObject(Size, Alignment, 0, false, IsSpillSlot, Alloca,
59 int Index = (int)Objects.size() - NumFixedObjects - 1;
66 int MachineFrameInfo::CreateSpillStackObject(uint64_t Size, Align Alignment) {
68 CreateStackObject(Size, Alignment, true);
69 int Index = (int)Objects.size() - NumFixedObjects - 1;
74 int MachineFrameInfo::CreateVariableSizedObject(Align Alignment,
80 return (int)Objects.size()-NumFixedObjects-1;
83 int MachineFrameInfo::CreateFixedObject(uint64_t Size, int64_t SPOffset,
85 assert(Size != 0 && "Cannot allocate zero size fixed stack objects!");
88 // the stack is guaranteed to be 16-byte aligned, then we know that the
89 // object is 16-byte aligned. Note that unlike the non-fixed case, if the
92 Align Alignment =
93 commonAlignment(ForcedRealign ? Align(1) : StackAlignment, SPOffset);
96 StackObject(Size, Alignment, SPOffset, IsImmutable,
99 return -++NumFixedObjects;
102 int MachineFrameInfo::CreateFixedSpillStackObject(uint64_t Size,
105 Align Alignment =
106 commonAlignment(ForcedRealign ? Align(1) : StackAlignment, SPOffset);
109 StackObject(Size, Alignment, SPOffset, IsImmutable,
112 return -++NumFixedObjects;
117 BitVector BV(TRI->getNumRegs());
131 for (MCPhysReg S : TRI->subregs_inclusive(I.getReg()))
140 Align MaxAlign = getMaxAlign();
148 // Only estimate stack size of default stack.
151 int64_t FixedOff = -getObjectOffset(i);
155 // Only estimate stack size of live objects on default stack.
159 Align Alignment = getObjectAlign(i);
166 if (adjustsStack() && TFI->hasReservedCallFrame(MF))
169 // Round up the size to a multiple of the alignment. If the function has
170 // any calls or alloca's, align to the target's StackAlignment value to
172 // otherwise, for leaf functions, align to the TransientStackAlignment
174 Align StackAlign;
176 (RegInfo->hasStackRealignment(MF) && getObjectIndexEnd() != 0))
177 StackAlign = TFI->getStackAlign();
179 StackAlign = TFI->getTransientStackAlign();
182 // SP not FP. Align to MaxAlign so this works.
200 uint64_t Size = TII.getFrameSize(MI);
201 MaxCallFrameSize = std::max(MaxCallFrameSize, Size);
203 FrameSDOps->push_back(&MI);
213 int ValOffset = (FI ? FI->getOffsetOfLocalArea() : 0);
217 for (unsigned i = 0, e = Objects.size(); i != e; ++i) {
219 OS << " fi#" << (int)(i-NumFixedObjects) << ": ";
224 if (SO.Size == ~0ULL) {
228 if (SO.Size == 0)
231 OS << "size=" << SO.Size;
232 OS << ", align=" << SO.Alignment.value();
236 if (i < NumFixedObjects || SO.SPOffset != -1) {
237 int64_t Off = SO.SPOffset - ValOffset;