[PATCH] D148368: [RemoveRedundantDebugValues] Track registers to efficiently handle many DBG_VALUEs.

Djordje Todorovic via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 24 04:12:09 PDT 2023


djtodoro added a comment.

Thanks for this!

So, currently you are trying to find a counterexample where this does not improve the build time, right?



================
Comment at: llvm/lib/CodeGen/RemoveRedundantDebugValues.cpp:143
     // Stop tracking any location that is clobbered by this instruction.
-    for (auto &Var : VariableMap) {
-      auto &LocOp = Var.second.first;
-      if (MI.modifiesRegister(LocOp->getReg(), TRI))
-        VariableMap.erase(Var.first);
+    for (const Register reg : RegisterSet) {
+      if (MI.modifiesRegister(reg, TRI)) {
----------------
```&Reg : ``` instead? 


================
Comment at: llvm/lib/CodeGen/RemoveRedundantDebugValues.cpp:144
+    for (const Register reg : RegisterSet) {
+      if (MI.modifiesRegister(reg, TRI)) {
+        for (auto &Var : VariableMap) {
----------------
an early exit here?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D148368/new/

https://reviews.llvm.org/D148368



More information about the llvm-commits mailing list