Skip to content

[NFC][AsmPrinter] Clarify handleNewDebugValue cache of TrackedRegs #71737

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions llvm/lib/CodeGen/AsmPrinter/DbgEntityHistoryCalculator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,18 @@ static void handleNewDebugValue(InlinedEntity Var, const MachineInstr &DV,
DbgValueHistoryMap &HistMap) {
EntryIndex NewIndex;
if (HistMap.startDbgValue(Var, DV, NewIndex)) {
// As we already need to iterate all LiveEntries when handling a DbgValue,
// we use this map to avoid a more expensive check against RegVars. There
// is an assert that we handle this correclty in addRegDescribedVar.
//
// In other terms, the presense in this map indicates the presense of a
// corresponding entry in RegVars.
//
// The bool value then tracks whether an entry is to be retained (true) or
// removed (false); as we end previous entries we speculatively assume they
// can be dropped from RegVars, but we then also visit the new entry whose
// set of debug register operands may overlap and "save" a reg from being
// dropped.
SmallDenseMap<unsigned, bool, 4> TrackedRegs;

// If we have created a new debug value entry, close all preceding
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.