[PATCH] D59942: [DebugInfo] Track multiple registers in DbgEntityHistoryCalculator

David Stenberg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 3 03:45:19 PDT 2019


dstenb added inline comments.


================
Comment at: lib/CodeGen/AsmPrinter/DbgEntityHistoryCalculator.cpp:186
+      LiveEntries[Var].insert(NewIndex);
+      TrackedRegs[NewReg] = true;
     }
----------------
aprantl wrote:
> for symmetry, perhaps write this as `TrackedRegs.insert({NewReg, true})`;
If it is okay, I'd prefer to keep it as it is, to be consistent with the compound-assignment a few lines above:

```
if (unsigned Reg = isDescribedByReg(DV))
  TrackedRegs[Reg] |= !Overlaps;
```


================
Comment at: lib/CodeGen/AsmPrinter/DbgEntityHistoryCalculator.cpp:190
+    // Drop tracking of registers that are no longer used.
+    for (auto I : TrackedRegs)
+      if (!I.second)
----------------
aprantl wrote:
> Is it safe to iterate over the map here, or can this introduce nondeterminism?
Yes, the iteration order does not matter here. The only effects (in non-crash cases) that each call to `dropRegDescribedVar(RegVars, I.first, Var)` has is:

  # Look up `VarSet = RegVars[I.first]` in the `RegVars` map.
  # Remove `Var` from the `VarSet` set.
  # Remove `I.first` from `RegVars` if `VarSet` is empty.




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

https://reviews.llvm.org/D59942





More information about the llvm-commits mailing list