[llvm-dev] RFC: Setting MachineInstr flags through storeRegToStackSlot

Alex Bradbury via llvm-dev llvm-dev at lists.llvm.org
Sun Feb 19 13:44:34 PST 2017


On 17 February 2017 at 23:14, Matthias Braun <mbraun at apple.com> wrote:
> Can someone familiar with debug info comment on whether it matters to have the FrameSetup flag on the callee save spills? We could have a smart spill or shrink wrapping algorithm that delays the callee saves to a later point in the program while executing non-prologue code first.

You make a good point, better understanding the importance (or lack of
importance) of setting the FrameSetup and FrameDestroy flags for debug
would be useful. The flags are useful for finding the end of the
callee save spills in emitPrologue and the beginning of the callee
save restored in emitEpilogue, but if it's not otherwise useful to
have them set that problem could be solved in other ways - for
instance passing these locations as arguments to
emitPrologue/emitEpilogue.

You make a good point about shrink wrapping -
DwarfDebug::findPrologueEndLoc seems to be one of the main places the
FrameSetup flag is checked. If shrink wrapping is applied, the frame
setup may not take place in the entry BB. The function could more
accurately described as findFirstNonPrologueLoc. For the
non-shrinkwrap case, is there any meaningful drawback for the
generated debug info if findPrologueEndLoc returns where callee saved
registers are spilled (like on MIPS) rather than the first
non-FrameSetup instruction after the spills (AArch64, X86)?

Best,

Alex


More information about the llvm-dev mailing list