[PATCH] D21808: [WebAssembly] Handle debug information and virtual registers without crashing

Matthias Braun via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 28 16:53:00 PDT 2016


MatzeB resigned from this revision.
MatzeB removed a reviewer: MatzeB.
MatzeB added a comment.

With no regalloc bits left I leave the rest of the review to webassembly people.


================
Comment at: lib/Target/WebAssembly/WebAssemblyRegStackify.cpp:261-262
@@ -260,2 +260,4 @@
   for (auto I : MRI.use_nodbg_operands(Reg)) {
+    if (I.getParent()->isDebugValue())
+      continue;
     const auto &Result = LI.Query(LIS.getInstructionIndex(*I.getParent()));
----------------
This situation should still be impossible.

================
Comment at: lib/Target/WebAssembly/WebAssemblyStoreResults.cpp:102-106
@@ -101,3 +101,7 @@
     // If this use gets a different value, skip it.
-    SlotIndex WhereIdx = LIS.getInstructionIndex(*Where);
+    SlotIndex WhereIdx;
+    if (Where->isDebugValue())
+      WhereIdx = LIS.getSlotIndexes()->getIndexBefore(*Where);
+    else
+      WhereIdx = LIS.getInstructionIndex(*Where);
     VNInfo *WhereVNI = FromLI->getVNInfoAt(WhereIdx);
----------------
wouldn't it be easier to use a use_nodbg iterator instead of doing extra checks here?


http://reviews.llvm.org/D21808





More information about the llvm-commits mailing list