@@ -119,33 +119,17 @@ class DbgVariableValue {
119
119
DIExpression::replaceArg (Expression, OpIdx, DuplicatingIdx);
120
120
}
121
121
}
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 ());
149
133
}
150
134
}
151
135
0 commit comments