[PATCH] D71593: [DebugInfo] Call site entries cannot be generated for FrameSetup calls

Lewis Revill via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 17 01:54:55 PST 2019


lewis-revill created this revision.
Herald added subscribers: llvm-commits, luismarques, simoncook, s.egerton, lenary, PkmX, hiraditya.
Herald added a project: LLVM.
lewis-revill added reviewers: simoncook, shiva0217.

Instructions marked as FrameSetup do not cause requestLabelAfterInsn to be called and so no such label is generated. Call instructions which require call site entries to be generated require this label to be present in order to calculate the return PC offset/address, but the check for whether the call instruction is marked as FrameSetup was not present.

Therefore in the case where a call instruction is marked as FrameSetup, an assertion failure occurs if a call site entry is to be generated. This is the case with RISC-V's implementation of save/restore via library calls (see https://reviews.llvm.org/D62686).


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D71593

Files:
  llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp


Index: llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
===================================================================
--- llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -722,6 +722,11 @@
       if (!MI.isCall())
         continue;
 
+      // Skip instructions marked as frame setup, since these will not have been
+      // given labels to calculate PC offset/location from.
+      if (MI.getFlag(MachineInstr::FrameSetup))
+        continue;
+
       // TODO: Add support for targets with delay slots (see: beginInstruction).
       if (MI.hasDelaySlot())
         return;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D71593.234073.patch
Type: text/x-patch
Size: 621 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191217/4a669164/attachment.bin>


More information about the llvm-commits mailing list