Skip to content

Commit ad4a582

Browse files
authored
[llvm] Consistently respect naked fn attribute in TargetFrameLowering::hasFP() (#106014)
Some targets (e.g. PPC and Hexagon) already did this. I think it's best to do this consistently so that frontend authors don't run into inconsistent results when they emit `naked` functions. For example, in Zig, we had to change our emit code to also set `frame-pointer=none` to get reliable results across targets. Note: I don't have commit access.
1 parent b497010 commit ad4a582

File tree

72 files changed

+1085
-90
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+1085
-90
lines changed

llvm/include/llvm/CodeGen/TargetFrameLowering.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,11 @@ class TargetFrameLowering {
280280
/// hasFP - Return true if the specified function should have a dedicated
281281
/// frame pointer register. For most targets this is true only if the function
282282
/// has variable sized allocas or if frame pointer elimination is disabled.
283-
virtual bool hasFP(const MachineFunction &MF) const = 0;
283+
/// For all targets, this is false if the function has the naked attribute
284+
/// since there is no prologue to set up the frame pointer.
285+
bool hasFP(const MachineFunction &MF) const {
286+
return !MF.getFunction().hasFnAttribute(Attribute::Naked) && hasFPImpl(MF);
287+
}
284288

285289
/// hasReservedCallFrame - Under normal circumstances, when a frame pointer is
286290
/// not required, we reserve argument space for call sites in the function
@@ -477,6 +481,9 @@ class TargetFrameLowering {
477481
/// targets can emit remarks based on the final frame layout.
478482
virtual void emitRemarks(const MachineFunction &MF,
479483
MachineOptimizationRemarkEmitter *ORE) const {};
484+
485+
protected:
486+
virtual bool hasFPImpl(const MachineFunction &MF) const = 0;
480487
};
481488

482489
} // End llvm namespace

llvm/lib/Target/AArch64/AArch64FrameLowering.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -480,9 +480,9 @@ bool AArch64FrameLowering::canUseRedZone(const MachineFunction &MF) const {
480480
getSVEStackSize(MF) || LowerQRegCopyThroughMem);
481481
}
482482

483-
/// hasFP - Return true if the specified function should have a dedicated frame
484-
/// pointer register.
485-
bool AArch64FrameLowering::hasFP(const MachineFunction &MF) const {
483+
/// hasFPImpl - Return true if the specified function should have a dedicated
484+
/// frame pointer register.
485+
bool AArch64FrameLowering::hasFPImpl(const MachineFunction &MF) const {
486486
const MachineFrameInfo &MFI = MF.getFrameInfo();
487487
const TargetRegisterInfo *RegInfo = MF.getSubtarget().getRegisterInfo();
488488

llvm/lib/Target/AArch64/AArch64FrameLowering.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ class AArch64FrameLowering : public TargetFrameLowering {
6565
/// Can this function use the red zone for local allocations.
6666
bool canUseRedZone(const MachineFunction &MF) const;
6767

68-
bool hasFP(const MachineFunction &MF) const override;
6968
bool hasReservedCallFrame(const MachineFunction &MF) const override;
7069

7170
bool assignCalleeSavedSpillSlots(MachineFunction &MF,
@@ -125,6 +124,9 @@ class AArch64FrameLowering : public TargetFrameLowering {
125124
orderFrameObjects(const MachineFunction &MF,
126125
SmallVectorImpl<int> &ObjectsToAllocate) const override;
127126

127+
protected:
128+
bool hasFPImpl(const MachineFunction &MF) const override;
129+
128130
private:
129131
/// Returns true if a homogeneous prolog or epilog code can be emitted
130132
/// for the size optimization. If so, HOM_Prolog/HOM_Epilog pseudo

llvm/lib/Target/AMDGPU/R600FrameLowering.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,8 @@ class R600FrameLowering : public AMDGPUFrameLowering {
2727
StackOffset getFrameIndexReference(const MachineFunction &MF, int FI,
2828
Register &FrameReg) const override;
2929

30-
bool hasFP(const MachineFunction &MF) const override {
31-
return false;
32-
}
30+
protected:
31+
bool hasFPImpl(const MachineFunction &MF) const override { return false; }
3332
};
3433

3534
} // end namespace llvm

llvm/lib/Target/AMDGPU/SIFrameLowering.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1805,7 +1805,7 @@ static bool frameTriviallyRequiresSP(const MachineFrameInfo &MFI) {
18051805
// The FP for kernels is always known 0, so we never really need to setup an
18061806
// explicit register for it. However, DisableFramePointerElim will force us to
18071807
// use a register for it.
1808-
bool SIFrameLowering::hasFP(const MachineFunction &MF) const {
1808+
bool SIFrameLowering::hasFPImpl(const MachineFunction &MF) const {
18091809
const MachineFrameInfo &MFI = MF.getFrameInfo();
18101810

18111811
// For entry & chain functions we can use an immediate offset in most cases,

llvm/lib/Target/AMDGPU/SIFrameLowering.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@ class SIFrameLowering final : public AMDGPUFrameLowering {
6666
MachineBasicBlock &MBB,
6767
MachineBasicBlock::iterator MI) const override;
6868

69+
protected:
70+
bool hasFPImpl(const MachineFunction &MF) const override;
71+
6972
private:
7073
void emitEntryFunctionFlatScratchInit(MachineFunction &MF,
7174
MachineBasicBlock &MBB,
@@ -82,8 +85,6 @@ class SIFrameLowering final : public AMDGPUFrameLowering {
8285
Register ScratchWaveOffsetReg) const;
8386

8487
public:
85-
bool hasFP(const MachineFunction &MF) const override;
86-
8788
bool requiresStackPointerReference(const MachineFunction &MF) const;
8889
};
8990

llvm/lib/Target/ARC/ARCFrameLowering.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,7 @@ MachineBasicBlock::iterator ARCFrameLowering::eliminateCallFramePseudoInstr(
487487
return MBB.erase(I);
488488
}
489489

490-
bool ARCFrameLowering::hasFP(const MachineFunction &MF) const {
490+
bool ARCFrameLowering::hasFPImpl(const MachineFunction &MF) const {
491491
const TargetRegisterInfo *RegInfo = MF.getSubtarget().getRegisterInfo();
492492
bool HasFP = MF.getTarget().Options.DisableFramePointerElim(MF) ||
493493
MF.getFrameInfo().hasVarSizedObjects() ||

llvm/lib/Target/ARC/ARCFrameLowering.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,6 @@ class ARCFrameLowering : public TargetFrameLowering {
5454
void processFunctionBeforeFrameFinalized(MachineFunction &MF,
5555
RegScavenger *RS) const override;
5656

57-
bool hasFP(const MachineFunction &MF) const override;
58-
5957
MachineBasicBlock::iterator
6058
eliminateCallFramePseudoInstr(MachineFunction &MF, MachineBasicBlock &MBB,
6159
MachineBasicBlock::iterator I) const override;
@@ -64,6 +62,9 @@ class ARCFrameLowering : public TargetFrameLowering {
6462
llvm::MachineFunction &, const llvm::TargetRegisterInfo *,
6563
std::vector<llvm::CalleeSavedInfo> &) const override;
6664

65+
protected:
66+
bool hasFPImpl(const MachineFunction &MF) const override;
67+
6768
private:
6869
void adjustStackToMatchRecords(MachineBasicBlock &MBB,
6970
MachineBasicBlock::iterator MI,

llvm/lib/Target/ARM/ARMFrameLowering.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -323,10 +323,10 @@ bool ARMFrameLowering::enableCalleeSaveSkip(const MachineFunction &MF) const {
323323
return true;
324324
}
325325

326-
/// hasFP - Return true if the specified function should have a dedicated frame
327-
/// pointer register. This is true if the function has variable sized allocas
328-
/// or if frame pointer elimination is disabled.
329-
bool ARMFrameLowering::hasFP(const MachineFunction &MF) const {
326+
/// hasFPImpl - Return true if the specified function should have a dedicated
327+
/// frame pointer register. This is true if the function has variable sized
328+
/// allocas or if frame pointer elimination is disabled.
329+
bool ARMFrameLowering::hasFPImpl(const MachineFunction &MF) const {
330330
const TargetRegisterInfo *RegInfo = MF.getSubtarget().getRegisterInfo();
331331
const MachineFrameInfo &MFI = MF.getFrameInfo();
332332

llvm/lib/Target/ARM/ARMFrameLowering.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ class ARMFrameLowering : public TargetFrameLowering {
4545

4646
bool enableCalleeSaveSkip(const MachineFunction &MF) const override;
4747

48-
bool hasFP(const MachineFunction &MF) const override;
4948
bool isFPReserved(const MachineFunction &MF) const;
5049
bool requiresAAPCSFrameRecord(const MachineFunction &MF) const;
5150
bool hasReservedCallFrame(const MachineFunction &MF) const override;
@@ -87,6 +86,9 @@ class ARMFrameLowering : public TargetFrameLowering {
8786
const SpillSlot *
8887
getCalleeSavedSpillSlots(unsigned &NumEntries) const override;
8988

89+
protected:
90+
bool hasFPImpl(const MachineFunction &MF) const override;
91+
9092
private:
9193
void emitPushInst(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI,
9294
ArrayRef<CalleeSavedInfo> CSI, unsigned StmOpc,

llvm/lib/Target/AVR/AVRFrameLowering.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ void AVRFrameLowering::emitEpilogue(MachineFunction &MF,
232232
//
233233
// Notice that strictly this is not a frame pointer because it contains SP after
234234
// frame allocation instead of having the original SP in function entry.
235-
bool AVRFrameLowering::hasFP(const MachineFunction &MF) const {
235+
bool AVRFrameLowering::hasFPImpl(const MachineFunction &MF) const {
236236
const AVRMachineFunctionInfo *FuncInfo = MF.getInfo<AVRMachineFunctionInfo>();
237237

238238
return (FuncInfo->getHasSpills() || FuncInfo->getHasAllocas() ||

llvm/lib/Target/AVR/AVRFrameLowering.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ class AVRFrameLowering : public TargetFrameLowering {
2121
public:
2222
void emitPrologue(MachineFunction &MF, MachineBasicBlock &MBB) const override;
2323
void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const override;
24-
bool hasFP(const MachineFunction &MF) const override;
2524
bool spillCalleeSavedRegisters(MachineBasicBlock &MBB,
2625
MachineBasicBlock::iterator MI,
2726
ArrayRef<CalleeSavedInfo> CSI,
@@ -38,6 +37,9 @@ class AVRFrameLowering : public TargetFrameLowering {
3837
MachineBasicBlock::iterator
3938
eliminateCallFramePseudoInstr(MachineFunction &MF, MachineBasicBlock &MBB,
4039
MachineBasicBlock::iterator MI) const override;
40+
41+
protected:
42+
bool hasFPImpl(const MachineFunction &MF) const override;
4143
};
4244

4345
} // end namespace llvm

llvm/lib/Target/BPF/BPFFrameLowering.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@
2020

2121
using namespace llvm;
2222

23-
bool BPFFrameLowering::hasFP(const MachineFunction &MF) const { return true; }
23+
bool BPFFrameLowering::hasFPImpl(const MachineFunction &MF) const {
24+
return true;
25+
}
2426

2527
void BPFFrameLowering::emitPrologue(MachineFunction &MF,
2628
MachineBasicBlock &MBB) const {}

llvm/lib/Target/BPF/BPFFrameLowering.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ class BPFFrameLowering : public TargetFrameLowering {
2626
void emitPrologue(MachineFunction &MF, MachineBasicBlock &MBB) const override;
2727
void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const override;
2828

29-
bool hasFP(const MachineFunction &MF) const override;
3029
void determineCalleeSaves(MachineFunction &MF, BitVector &SavedRegs,
3130
RegScavenger *RS) const override;
3231

@@ -35,6 +34,9 @@ class BPFFrameLowering : public TargetFrameLowering {
3534
MachineBasicBlock::iterator MI) const override {
3635
return MBB.erase(MI);
3736
}
37+
38+
protected:
39+
bool hasFPImpl(const MachineFunction &MF) const override;
3840
};
3941
}
4042
#endif

llvm/lib/Target/CSKY/CSKYFrameLowering.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ static Register getFPReg(const CSKYSubtarget &STI) { return CSKY::R8; }
3333
// callee saved register to save the value.
3434
static Register getBPReg(const CSKYSubtarget &STI) { return CSKY::R7; }
3535

36-
bool CSKYFrameLowering::hasFP(const MachineFunction &MF) const {
36+
bool CSKYFrameLowering::hasFPImpl(const MachineFunction &MF) const {
3737
const TargetRegisterInfo *RegInfo = MF.getSubtarget().getRegisterInfo();
3838

3939
const MachineFrameInfo &MFI = MF.getFrameInfo();

llvm/lib/Target/CSKY/CSKYFrameLowering.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,16 @@ class CSKYFrameLowering : public TargetFrameLowering {
6161
MutableArrayRef<CalleeSavedInfo> CSI,
6262
const TargetRegisterInfo *TRI) const override;
6363

64-
bool hasFP(const MachineFunction &MF) const override;
6564
bool hasBP(const MachineFunction &MF) const;
6665

6766
bool hasReservedCallFrame(const MachineFunction &MF) const override;
6867

6968
MachineBasicBlock::iterator
7069
eliminateCallFramePseudoInstr(MachineFunction &MF, MachineBasicBlock &MBB,
7170
MachineBasicBlock::iterator MI) const override;
71+
72+
protected:
73+
bool hasFPImpl(const MachineFunction &MF) const override;
7274
};
7375
} // namespace llvm
7476
#endif

llvm/lib/Target/DirectX/DirectXFrameLowering.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ class DirectXFrameLowering : public TargetFrameLowering {
2929
void emitPrologue(MachineFunction &, MachineBasicBlock &) const override {}
3030
void emitEpilogue(MachineFunction &, MachineBasicBlock &) const override {}
3131

32-
bool hasFP(const MachineFunction &) const override { return false; }
32+
protected:
33+
bool hasFPImpl(const MachineFunction &) const override { return false; }
3334
};
3435
} // namespace llvm
3536
#endif // LLVM_DIRECTX_DIRECTXFRAMELOWERING_H

llvm/lib/Target/Hexagon/HexagonFrameLowering.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1144,10 +1144,7 @@ void HexagonFrameLowering::insertCFIInstructionsAt(MachineBasicBlock &MBB,
11441144
}
11451145
}
11461146

1147-
bool HexagonFrameLowering::hasFP(const MachineFunction &MF) const {
1148-
if (MF.getFunction().hasFnAttribute(Attribute::Naked))
1149-
return false;
1150-
1147+
bool HexagonFrameLowering::hasFPImpl(const MachineFunction &MF) const {
11511148
auto &MFI = MF.getFrameInfo();
11521149
auto &HRI = *MF.getSubtarget<HexagonSubtarget>().getRegisterInfo();
11531150
bool HasExtraAlign = HRI.hasStackRealignment(MF);

llvm/lib/Target/Hexagon/HexagonFrameLowering.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ class HexagonFrameLowering : public TargetFrameLowering {
8989

9090
StackOffset getFrameIndexReference(const MachineFunction &MF, int FI,
9191
Register &FrameReg) const override;
92-
bool hasFP(const MachineFunction &MF) const override;
9392

9493
const SpillSlot *getCalleeSavedSpillSlots(unsigned &NumEntries)
9594
const override {
@@ -114,6 +113,9 @@ class HexagonFrameLowering : public TargetFrameLowering {
114113

115114
void insertCFIInstructions(MachineFunction &MF) const;
116115

116+
protected:
117+
bool hasFPImpl(const MachineFunction &MF) const override;
118+
117119
private:
118120
using CSIVect = std::vector<CalleeSavedInfo>;
119121

llvm/lib/Target/Lanai/LanaiFrameLowering.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,11 @@ class LanaiFrameLowering : public TargetFrameLowering {
4444
eliminateCallFramePseudoInstr(MachineFunction &MF, MachineBasicBlock &MBB,
4545
MachineBasicBlock::iterator I) const override;
4646

47-
bool hasFP(const MachineFunction & /*MF*/) const override { return true; }
48-
4947
void determineCalleeSaves(MachineFunction &MF, BitVector &SavedRegs,
5048
RegScavenger *RS = nullptr) const override;
49+
50+
protected:
51+
bool hasFPImpl(const MachineFunction & /*MF*/) const override { return true; }
5152
};
5253

5354
} // namespace llvm

llvm/lib/Target/LoongArch/LoongArchFrameLowering.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ using namespace llvm;
3131
// pointer register. This is true if frame pointer elimination is
3232
// disabled, if it needs dynamic stack realignment, if the function has
3333
// variable sized allocas, or if the frame address is taken.
34-
bool LoongArchFrameLowering::hasFP(const MachineFunction &MF) const {
34+
bool LoongArchFrameLowering::hasFPImpl(const MachineFunction &MF) const {
3535
const TargetRegisterInfo *RegInfo = MF.getSubtarget().getRegisterInfo();
3636

3737
const MachineFrameInfo &MFI = MF.getFrameInfo();

llvm/lib/Target/LoongArch/LoongArchFrameLowering.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,15 @@ class LoongArchFrameLowering : public TargetFrameLowering {
4949
StackOffset getFrameIndexReference(const MachineFunction &MF, int FI,
5050
Register &FrameReg) const override;
5151

52-
bool hasFP(const MachineFunction &MF) const override;
5352
bool hasBP(const MachineFunction &MF) const;
5453

5554
uint64_t getFirstSPAdjustAmount(const MachineFunction &MF) const;
5655

5756
bool enableShrinkWrapping(const MachineFunction &MF) const override;
5857

58+
protected:
59+
bool hasFPImpl(const MachineFunction &MF) const override;
60+
5961
private:
6062
void determineFrameLayout(MachineFunction &MF) const;
6163
void adjustReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI,

llvm/lib/Target/M68k/M68kFrameLowering.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ M68kFrameLowering::M68kFrameLowering(const M68kSubtarget &STI, Align Alignment)
4040
StackPtr = TRI->getStackRegister();
4141
}
4242

43-
bool M68kFrameLowering::hasFP(const MachineFunction &MF) const {
43+
bool M68kFrameLowering::hasFPImpl(const MachineFunction &MF) const {
4444
const MachineFrameInfo &MFI = MF.getFrameInfo();
4545
const TargetRegisterInfo *TRI = STI.getRegisterInfo();
4646

llvm/lib/Target/M68k/M68kFrameLowering.h

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -121,12 +121,6 @@ class M68kFrameLowering : public TargetFrameLowering {
121121
MutableArrayRef<CalleeSavedInfo> CSI,
122122
const TargetRegisterInfo *TRI) const override;
123123

124-
/// Return true if the specified function should have a dedicated frame
125-
/// pointer register. This is true if the function has variable sized
126-
/// allocas, if it needs dynamic stack realignment, if frame pointer
127-
/// elimination is disabled, or if the frame address is taken.
128-
bool hasFP(const MachineFunction &MF) const override;
129-
130124
/// Under normal circumstances, when a frame pointer is not required, we
131125
/// reserve argument space for call sites in the function immediately on
132126
/// entry to the current function. This eliminates the need for add/sub sp
@@ -166,6 +160,13 @@ class M68kFrameLowering : public TargetFrameLowering {
166160
/// pointer by a constant value.
167161
void emitSPUpdate(MachineBasicBlock &MBB, MachineBasicBlock::iterator &MBBI,
168162
int64_t NumBytes, bool InEpilogue) const;
163+
164+
protected:
165+
/// Return true if the specified function should have a dedicated frame
166+
/// pointer register. This is true if the function has variable sized
167+
/// allocas, if it needs dynamic stack realignment, if frame pointer
168+
/// elimination is disabled, or if the frame address is taken.
169+
bool hasFPImpl(const MachineFunction &MF) const override;
169170
};
170171
} // namespace llvm
171172

llvm/lib/Target/MSP430/MSP430FrameLowering.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ MSP430FrameLowering::MSP430FrameLowering(const MSP430Subtarget &STI)
3030
Align(2)),
3131
STI(STI), TII(*STI.getInstrInfo()), TRI(STI.getRegisterInfo()) {}
3232

33-
bool MSP430FrameLowering::hasFP(const MachineFunction &MF) const {
33+
bool MSP430FrameLowering::hasFPImpl(const MachineFunction &MF) const {
3434
const MachineFrameInfo &MFI = MF.getFrameInfo();
3535

3636
return (MF.getTarget().Options.DisableFramePointerElim(MF) ||

llvm/lib/Target/MSP430/MSP430FrameLowering.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ class MSP430RegisterInfo;
2424

2525
class MSP430FrameLowering : public TargetFrameLowering {
2626
protected:
27+
bool hasFPImpl(const MachineFunction &MF) const override;
2728

2829
public:
2930
MSP430FrameLowering(const MSP430Subtarget &STI);
@@ -51,7 +52,6 @@ class MSP430FrameLowering : public TargetFrameLowering {
5152
MutableArrayRef<CalleeSavedInfo> CSI,
5253
const TargetRegisterInfo *TRI) const override;
5354

54-
bool hasFP(const MachineFunction &MF) const override;
5555
bool hasReservedCallFrame(const MachineFunction &MF) const override;
5656
void processFunctionBeforeFrameFinalized(MachineFunction &MF,
5757
RegScavenger *RS = nullptr) const override;

llvm/lib/Target/Mips/MipsFrameLowering.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,11 @@ const MipsFrameLowering *MipsFrameLowering::create(const MipsSubtarget &ST) {
8686
return llvm::createMipsSEFrameLowering(ST);
8787
}
8888

89-
// hasFP - Return true if the specified function should have a dedicated frame
90-
// pointer register. This is true if the function has variable sized allocas,
91-
// if it needs dynamic stack realignment, if frame pointer elimination is
92-
// disabled, or if the frame address is taken.
93-
bool MipsFrameLowering::hasFP(const MachineFunction &MF) const {
89+
// hasFPImpl - Return true if the specified function should have a dedicated
90+
// frame pointer register. This is true if the function has variable sized
91+
// allocas, if it needs dynamic stack realignment, if frame pointer elimination
92+
// is disabled, or if the frame address is taken.
93+
bool MipsFrameLowering::hasFPImpl(const MachineFunction &MF) const {
9494
const MachineFrameInfo &MFI = MF.getFrameInfo();
9595
const TargetRegisterInfo *TRI = STI.getRegisterInfo();
9696

0 commit comments

Comments
 (0)