[PATCH] D20178: Fix PR26055 - LiveDebugValues is very slow

Daniel Berlin via llvm-commits llvm-commits at lists.llvm.org
Sun May 15 10:40:36 PDT 2016


dberlin added inline comments.

================
Comment at: lib/CodeGen/LiveDebugValues.cpp:250
@@ +249,3 @@
+    // diferent inlined copies of the same variable, but querying the
+    // DebugLoc of a MachineInstr is very expensive.
+    if (VL.Var.Var == RawVar)
----------------
Errr, this seems like a regression :P
Also, if you want to float this idea, IMHO, you should split up this patch: 

First, make it do the same thing with sparsebitvectors
Second, make any functionality/design changes you want on top of that.


================
Comment at: lib/CodeGen/LiveDebugValues.cpp:275
@@ -230,1 +274,3 @@
+          if (VarLocIDs[ID].isDescribedByReg() == *RAI)
+            OpenRanges.reset(ID);
     } else if (MO.isRegMask()) {
----------------
Are you positive of the invalidation semantics of sparsebitvector iterators?

In particular, what happens if the reset call causes the current element to go away?
I do believe that will cause the iterator to be invalidated.

(Also, this is N^2)

================
Comment at: lib/CodeGen/LiveDebugValues.cpp:285
@@ -242,1 +284,3 @@
+          OpenRanges.reset(ID);
+      }
     }
----------------
Ditto iterator invalidation here.

You have have to make a temporary sparsebitmap and subtract it (intersectwithcomplement)



http://reviews.llvm.org/D20178





More information about the llvm-commits mailing list