@@ -721,6 +721,14 @@ struct StackAdjustingInsts {
721
721
MachineBasicBlock::iterator I;
722
722
unsigned SPAdjust;
723
723
bool BeforeFPSet;
724
+
725
+ #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
726
+ void dump () {
727
+ dbgs () << " " << (BeforeFPSet ? " before-fp " : " " )
728
+ << " sp-adjust=" << SPAdjust;
729
+ I->dump ();
730
+ }
731
+ #endif
724
732
};
725
733
726
734
SmallVector<InstInfo, 4 > Insts;
@@ -755,6 +763,14 @@ struct StackAdjustingInsts {
755
763
.setMIFlags (MachineInstr::FrameSetup);
756
764
}
757
765
}
766
+
767
+ #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
768
+ void dump () {
769
+ dbgs () << " StackAdjustingInsts:\n " ;
770
+ for (auto &Info : Insts)
771
+ Info.dump ();
772
+ }
773
+ #endif
758
774
};
759
775
760
776
} // end anonymous namespace
@@ -874,6 +890,8 @@ void ARMFrameLowering::emitPrologue(MachineFunction &MF,
874
890
ARMSubtarget::PushPopSplitVariation PushPopSplit =
875
891
STI.getPushPopSplitVariation (MF);
876
892
893
+ LLVM_DEBUG (dbgs () << " Emitting prologue for " << MF.getName () << " \n " );
894
+
877
895
// Debug location must be unknown since the first debug location is used
878
896
// to determine the end of the prologue.
879
897
DebugLoc dl;
@@ -1246,8 +1264,10 @@ void ARMFrameLowering::emitPrologue(MachineFunction &MF,
1246
1264
// throughout the process. If we have a frame pointer, it takes over the job
1247
1265
// half-way through, so only the first few .cfi_def_cfa_offset instructions
1248
1266
// actually get emitted.
1249
- if (!NeedsWinCFI)
1267
+ if (!NeedsWinCFI) {
1268
+ LLVM_DEBUG (DefCFAOffsetCandidates.dump ());
1250
1269
DefCFAOffsetCandidates.emitDefCFAOffsets (MBB, dl, TII, HasFP);
1270
+ }
1251
1271
1252
1272
if (STI.isTargetELF () && hasFP (MF))
1253
1273
MFI.setOffsetAdjustment (MFI.getOffsetAdjustment () -
@@ -1327,6 +1347,8 @@ void ARMFrameLowering::emitEpilogue(MachineFunction &MF,
1327
1347
ARMSubtarget::PushPopSplitVariation PushPopSplit =
1328
1348
STI.getPushPopSplitVariation (MF);
1329
1349
1350
+ LLVM_DEBUG (dbgs () << " Emitting epilogue for " << MF.getName () << " \n " );
1351
+
1330
1352
// Amount of stack space we reserved next to incoming args for either
1331
1353
// varargs registers or stack arguments in tail calls made by this function.
1332
1354
unsigned ReservedArgStack = AFI->getArgRegsSaveSize ();
0 commit comments