@@ -689,6 +689,14 @@ struct StackAdjustingInsts {
689
689
MachineBasicBlock::iterator I;
690
690
unsigned SPAdjust;
691
691
bool BeforeFPSet;
692
+
693
+ #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
694
+ void dump () {
695
+ dbgs () << " " << (BeforeFPSet ? " before-fp " : " " )
696
+ << " sp-adjust=" << SPAdjust;
697
+ I->dump ();
698
+ }
699
+ #endif
692
700
};
693
701
694
702
SmallVector<InstInfo, 4 > Insts;
@@ -723,6 +731,14 @@ struct StackAdjustingInsts {
723
731
.setMIFlags (MachineInstr::FrameSetup);
724
732
}
725
733
}
734
+
735
+ #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
736
+ void dump () {
737
+ dbgs () << " StackAdjustingInsts:\n " ;
738
+ for (auto &Info : Insts)
739
+ Info.dump ();
740
+ }
741
+ #endif
726
742
};
727
743
728
744
} // end anonymous namespace
@@ -842,6 +858,8 @@ void ARMFrameLowering::emitPrologue(MachineFunction &MF,
842
858
ARMSubtarget::PushPopSplitVariation PushPopSplit =
843
859
STI.getPushPopSplitVariation (MF);
844
860
861
+ LLVM_DEBUG (dbgs () << " Emitting prologue for " << MF.getName () << " \n " );
862
+
845
863
// Debug location must be unknown since the first debug location is used
846
864
// to determine the end of the prologue.
847
865
DebugLoc dl;
@@ -1213,8 +1231,10 @@ void ARMFrameLowering::emitPrologue(MachineFunction &MF,
1213
1231
// throughout the process. If we have a frame pointer, it takes over the job
1214
1232
// half-way through, so only the first few .cfi_def_cfa_offset instructions
1215
1233
// actually get emitted.
1216
- if (!NeedsWinCFI)
1234
+ if (!NeedsWinCFI) {
1235
+ LLVM_DEBUG (DefCFAOffsetCandidates.dump ());
1217
1236
DefCFAOffsetCandidates.emitDefCFAOffsets (MBB, dl, TII, HasFP);
1237
+ }
1218
1238
1219
1239
if (STI.isTargetELF () && hasFP (MF))
1220
1240
MFI.setOffsetAdjustment (MFI.getOffsetAdjustment () -
@@ -1294,6 +1314,8 @@ void ARMFrameLowering::emitEpilogue(MachineFunction &MF,
1294
1314
ARMSubtarget::PushPopSplitVariation PushPopSplit =
1295
1315
STI.getPushPopSplitVariation (MF);
1296
1316
1317
+ LLVM_DEBUG (dbgs () << " Emitting epilogue for " << MF.getName () << " \n " );
1318
+
1297
1319
// Amount of stack space we reserved next to incoming args for either
1298
1320
// varargs registers or stack arguments in tail calls made by this function.
1299
1321
unsigned ReservedArgStack = AFI->getArgRegsSaveSize ();
0 commit comments