diff options
author | Jeremy Morse <jeremy.morse.llvm@gmail.com> | 2019-06-13 10:03:17 +0000 |
---|---|---|
committer | Jeremy Morse <jeremy.morse.llvm@gmail.com> | 2019-06-13 10:03:17 +0000 |
commit | 181bf0cefb261deae54c4292170491a2deb231d9 (patch) | |
tree | 4a3a5c99bd4ac78b4a349f00d152b99078977af6 /llvm/lib/CodeGen | |
parent | 848d3d0d2c45334f090dbf315501ebafe75f4b4d (diff) | |
download | bcm5719-llvm-181bf0cefb261deae54c4292170491a2deb231d9.tar.gz bcm5719-llvm-181bf0cefb261deae54c4292170491a2deb231d9.zip |
[DebugInfo] Use FrameDestroy to extend stack locations to end-of-function
We aim to ignore changes in variable locations during the prologue and
epilogue of functions, to avoid using space documenting location changes
that aren't visible. However in D61940 / r362951 this got ripped out as
the previous implementation was unsound.
Instead, use the FrameDestroy flag to identify when we're in the epilogue
of a function, and ignore variable location changes accordingly. This fits
in with existing code that examines the FrameSetup flag.
Some variable locations get shuffled in modified tests as they now cover
greater ranges, which is what would be expected. Some additional
single-location variables are generated too. Two tests are un-xfailed,
they were only xfailed due to r362951 deleting functionality they depended
on.
Apparently some out-of-tree backends don't accurately maintain FrameDestroy
flags -- if you're an out-of-tree maintainer and see changes in variable
locations disappear due to a faulty FrameDestroy flag, it's safe to back
this change out. The impact is just slightly more debug info than necessary.
Differential Revision: https://reviews.llvm.org/D62314
llvm-svn: 363245
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DbgEntityHistoryCalculator.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DbgEntityHistoryCalculator.cpp b/llvm/lib/CodeGen/AsmPrinter/DbgEntityHistoryCalculator.cpp index d87aac94c04..ee375529cf9 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DbgEntityHistoryCalculator.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DbgEntityHistoryCalculator.cpp @@ -275,9 +275,12 @@ void llvm::calculateDbgEntityHistory(const MachineFunction *MF, clobberRegisterUses(RegVars, MO.getReg(), DbgValues, LiveEntries, MI); // If this is a register def operand, it may end a debug value - // range. Ignore defs of the frame register in the prologue. + // range. Ignore frame-register defs in the epilogue and prologue, + // we expect debuggers to understand that stack-locations are + // invalid outside of the function body. else if (MO.getReg() != FrameReg || - !MI.getFlag(MachineInstr::FrameSetup)) { + (!MI.getFlag(MachineInstr::FrameDestroy) && + !MI.getFlag(MachineInstr::FrameSetup))) { for (MCRegAliasIterator AI(MO.getReg(), TRI, true); AI.isValid(); ++AI) clobberRegisterUses(RegVars, *AI, DbgValues, LiveEntries, MI); |