Skip to content

Commit cce513c

Browse files
committed
Move common flags
1 parent 3af56f3 commit cce513c

File tree

2 files changed

+11
-15
lines changed

2 files changed

+11
-15
lines changed

llvm/lib/Target/AArch64/AArch64PrologueEpilogue.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1219,6 +1219,7 @@ AArch64EpilogueEmitter::AArch64EpilogueEmitter(MachineFunction &MF,
12191219
const AArch64FrameLowering &AFL)
12201220
: AArch64PrologueEpilogueCommon(MF, MBB, AFL) {
12211221
EmitCFI = AFI->needsAsyncDwarfUnwindInfo(MF);
1222+
HomPrologEpilog = AFL.homogeneousPrologEpilog(MF, &MBB);
12221223
SEHEpilogueStartI = MBB.end();
12231224
}
12241225

@@ -1253,7 +1254,7 @@ void AArch64EpilogueEmitter::emitEpilogue() {
12531254
if (MF.hasEHFunclets())
12541255
AFI->setLocalStackSize(NumBytes - PrologueSaveSize);
12551256

1256-
if (AFL.homogeneousPrologEpilog(MF, &MBB)) {
1257+
if (HomPrologEpilog) {
12571258
assert(!NeedsWinCFI);
12581259
auto FirstHomogenousEpilogI = MBB.getFirstTerminator();
12591260
if (FirstHomogenousEpilogI != MBB.begin()) {

llvm/lib/Target/AArch64/AArch64PrologueEpilogue.h

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,13 @@ class AArch64PrologueEpilogueCommon {
6161
const AArch64FrameLowering &AFL;
6262
const AArch64RegisterInfo &RegInfo;
6363

64+
// Common flags. These generally should not change outside of the (possibly
65+
// derived) constructor.
6466
bool HasFP = false;
65-
bool NeedsWinCFI = false;
67+
bool EmitCFI = false; // Note: Set in derived constructors.
68+
bool IsFunclet = false; // Note: Set in derived constructors.
69+
bool NeedsWinCFI = false; // Note: Can be changed in emitFramePointerSetup.
70+
bool HomPrologEpilog = false; // Note: Set in derived constructors.
6671

6772
// Note: "HasWinCFI" is mutable as it can change in any "emit" function.
6873
mutable bool HasWinCFI = false;
@@ -132,14 +137,9 @@ class AArch64PrologueEmitter final : public AArch64PrologueEpilogueCommon {
132137
#endif
133138

134139
// Prologue flags. These generally should not change outside of the
135-
// constructor. Two exceptions are "CombineSPBump" which is set in
136-
// determineLocalsStackSize, and "NeedsWinCFI" which is set in
137-
// emitFramePointerSetup.
138-
bool EmitCFI = false;
140+
// constructor.
139141
bool EmitAsyncCFI = false;
140-
bool IsFunclet = false;
141-
bool CombineSPBump = false;
142-
bool HomPrologEpilog = false;
142+
bool CombineSPBump = false; // Note: This is set in determineLocalsStackSize.
143143
};
144144

145145
/// A helper class for emitting the epilogue. Substantial new functionality
@@ -178,13 +178,8 @@ class AArch64EpilogueEmitter final : public AArch64PrologueEpilogueCommon {
178178

179179
void finalizeEpilogue() const;
180180

181-
// Epilogue flags. These generally should not change outside of the
182-
// constructor (or early in emitEpilogue).
183-
bool EmitCFI = false;
184-
bool IsFunclet = false;
185-
186-
DebugLoc DL;
187181
MachineBasicBlock::iterator SEHEpilogueStartI;
182+
DebugLoc DL;
188183
};
189184

190185
} // namespace llvm

0 commit comments

Comments
 (0)