llvm.org GIT mirror llvm / 08ecb71
Fix PR10884. This PR basically reports a problem where a crash in generated code happened due to %rbp being clobbered: pushq %rbp movq %rsp, %rbp .... vmovmskps %ymm12, %ebp .... movq %rbp, %rsp popq %rbp ret Since Eric's r123367 commit, the default stack alignment for x86 32-bit has changed to be 16-bytes. Since then, the MaxStackAlignmentHeuristicPass hasn't been really used, but with AVX it becomes useful again, since per ABI compliance we don't always align the stack to 256-bit, but only when there are 256-bit incoming arguments. ReserveFP was only used by this pass, but there's no RA target hook that uses getReserveFP() to check for the presence of FP (since nothing was triggering the pass to run, the uses of getReserveFP() were removed through time without being noticed). Change this pass to use setForceFramePointer, which is properly called by MachineFunction hasFP method. The testcase is very big and dependent on RA, not sure if it's worth adding to test/CodeGen/X86. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139939 91177308-0d34-0410-b5e6-96231b3b80d8 Bruno Cardoso Lopes 9 years ago
2 changed file(s) with 1 addition(s) and 9 deletion(s). Raw diff Collapse all Expand all
5252 /// relocation models.
5353 unsigned GlobalBaseReg;
5454
55 /// ReserveFP - whether the function should reserve the frame pointer
56 /// when allocating, even if there may not actually be a frame pointer used.
57 bool ReserveFP;
58
5955 /// VarArgsFrameIndex - FrameIndex for start of varargs area.
6056 int VarArgsFrameIndex;
6157 /// RegSaveFrameIndex - X86-64 vararg func register save area.
9086 TailCallReturnAddrDelta(0),
9187 SRetReturnReg(0),
9288 GlobalBaseReg(0),
93 ReserveFP(false),
9489 VarArgsFrameIndex(0),
9590 RegSaveFrameIndex(0),
9691 VarArgsGPOffset(0),
118113 unsigned getGlobalBaseReg() const { return GlobalBaseReg; }
119114 void setGlobalBaseReg(unsigned Reg) { GlobalBaseReg = Reg; }
120115
121 bool getReserveFP() const { return ReserveFP; }
122 void setReserveFP(bool reserveFP) { ReserveFP = reserveFP; }
123
124116 int getVarArgsFrameIndex() const { return VarArgsFrameIndex; }
125117 void setVarArgsFrameIndex(int Idx) { VarArgsFrameIndex = Idx; }
126118
821821 for (unsigned i = 0, e = RI.getNumVirtRegs(); i != e; ++i) {
822822 unsigned Reg = TargetRegisterInfo::index2VirtReg(i);
823823 if (RI.getRegClass(Reg)->getAlignment() > StackAlignment) {
824 FuncInfo->setReserveFP(true);
824 FuncInfo->setForceFramePointer(true);
825825 return true;
826826 }
827827 }