[PATCH] D73581: [WIP] Preserve debug frame base information through register coloring

Derek Schuff via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 28 14:25:26 PST 2020


dschuff created this revision.
Herald added subscribers: llvm-commits, aheejin, hiraditya, jgravelle-google, sbc100.
Herald added a project: LLVM.

Still needs a good test.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D73581

Files:
  llvm/lib/Target/WebAssembly/WebAssemblyRegColoring.cpp


Index: llvm/lib/Target/WebAssembly/WebAssemblyRegColoring.cpp
===================================================================
--- llvm/lib/Target/WebAssembly/WebAssemblyRegColoring.cpp
+++ llvm/lib/Target/WebAssembly/WebAssemblyRegColoring.cpp
@@ -157,6 +157,10 @@
     Changed |= Old != New;
     UsedColors.set(Color);
     Assignments[Color].push_back(LI);
+    // If we reassigned the stack pointer, update the debug frame base info.
+    if (MFI.isFrameBaseVirtual() && MFI.getFrameBaseVreg() == Old) {
+      MFI.setFrameBaseVreg(New);
+    }
     LLVM_DEBUG(dbgs() << "Assigning vreg" << Register::virtReg2Index(LI->reg)
                       << " to vreg" << Register::virtReg2Index(New) << "\n");
   }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D73581.240996.patch
Type: text/x-patch
Size: 716 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200128/1a7b02aa/attachment.bin>


More information about the llvm-commits mailing list