Skip to content

Commit b11e4c9

Browse files
Revert "[DebugInfo] Drop DBG_VALUE_LISTs with an excessive number of debug operands"
This reverts commit b623df3c93983c4512aa54f2c706716bdf865a90, as per https://llvm.org/docs/DeveloperPolicy.html#patch-reversion-policy. Breakages observed downstream reported in: https://reviews.llvm.org/D91722#2724321 Fixes exist in: https://reviews.llvm.org/D101523 https://reviews.llvm.org/D101540 but haven't landed yet going into the weekend.
1 parent a45fd43 commit b11e4c9

File tree

2 files changed

+11
-75
lines changed

2 files changed

+11
-75
lines changed

llvm/lib/CodeGen/LiveDebugVariables.cpp

Lines changed: 11 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -119,33 +119,17 @@ class DbgVariableValue {
119119
DIExpression::replaceArg(Expression, OpIdx, DuplicatingIdx);
120120
}
121121
}
122-
// FIXME: Debug values referencing 64+ unique machine locations are rare and
123-
// currently unsupported for performance reasons. If we can verify that
124-
// performance is acceptable for such debug values, we can increase the
125-
// bit-width of LocNoCount to 14 to enable up to 16384 unique machine
126-
// locations. We will also need to verify that this does not cause issues
127-
// with LiveDebugVariables' use of IntervalMap.
128-
if (LocNoVec.size() < 64) {
129-
LocNoCount = LocNoVec.size();
130-
if (LocNoCount > 0) {
131-
LocNos = std::make_unique<unsigned[]>(LocNoCount);
132-
std::copy(LocNoVec.begin(), LocNoVec.end(), loc_nos_begin());
133-
}
134-
} else {
135-
LLVM_DEBUG(dbgs() << "Found debug value with 64+ unique machine "
136-
"locations, dropping...\n");
137-
LocNoCount = 1;
138-
// Turn this into an undef debug value list; right now, the simplest form
139-
// of this is an expression with one arg, and an undef debug operand.
140-
Expression =
141-
DIExpression::get(Expr.getContext(), {dwarf::DW_OP_LLVM_arg, 0,
142-
dwarf::DW_OP_stack_value});
143-
if (auto FragmentInfoOpt = Expr.getFragmentInfo())
144-
Expression = *DIExpression::createFragmentExpression(
145-
Expression, FragmentInfoOpt->OffsetInBits,
146-
FragmentInfoOpt->SizeInBits);
147-
LocNos = std::make_unique<unsigned[]>(LocNoCount);
148-
LocNos[0] = UndefLocNo;
122+
// A debug value referencing 64+ unique machine locations is very likely
123+
// to be the result of a bug earlier in the pipeline. If by some means this
124+
// limit is validly reached, then we can add a byte to the size of
125+
// LocNoCount.
126+
assert(LocNoVec.size() < 64 &&
127+
"debug value containing 64+ unique machine locations is not "
128+
"supported by Live Debug Variables");
129+
LocNoCount = LocNoVec.size();
130+
if (LocNoCount > 0) {
131+
LocNos.reset(new unsigned[LocNoCount]());
132+
std::copy(LocNoVec.begin(), LocNoVec.end(), loc_nos_begin());
149133
}
150134
}
151135

llvm/test/DebugInfo/X86/live-debug-vars-loc-limit.ll

Lines changed: 0 additions & 48 deletions
This file was deleted.

0 commit comments

Comments
 (0)