diff options
author | Nick Desaulniers <ndesaulniers@google.com> | 2021-04-30 16:35:41 -0700 |
---|---|---|
committer | Nick Desaulniers <ndesaulniers@google.com> | 2021-04-30 16:45:37 -0700 |
commit | b11e4c990771541e440861f017afea7b4ba162f4 (patch) | |
tree | 62c488fe63559534cb7397738f4e1159f52e45c7 /llvm/lib/CodeGen/LiveDebugVariables.cpp | |
parent | a45fd436aef4d5712da99f8292f5d0b16794892c (diff) | |
download | llvm-b11e4c990771541e440861f017afea7b4ba162f4.zip llvm-b11e4c990771541e440861f017afea7b4ba162f4.tar.gz llvm-b11e4c990771541e440861f017afea7b4ba162f4.tar.bz2 |
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.
Diffstat (limited to 'llvm/lib/CodeGen/LiveDebugVariables.cpp')
-rw-r--r-- | llvm/lib/CodeGen/LiveDebugVariables.cpp | 38 |
1 files changed, 11 insertions, 27 deletions
diff --git a/llvm/lib/CodeGen/LiveDebugVariables.cpp b/llvm/lib/CodeGen/LiveDebugVariables.cpp index 9de33d6..ce898cd 100644 --- a/llvm/lib/CodeGen/LiveDebugVariables.cpp +++ b/llvm/lib/CodeGen/LiveDebugVariables.cpp @@ -119,33 +119,17 @@ public: DIExpression::replaceArg(Expression, OpIdx, DuplicatingIdx); } } - // FIXME: Debug values referencing 64+ unique machine locations are rare and - // currently unsupported for performance reasons. If we can verify that - // performance is acceptable for such debug values, we can increase the - // bit-width of LocNoCount to 14 to enable up to 16384 unique machine - // locations. We will also need to verify that this does not cause issues - // with LiveDebugVariables' use of IntervalMap. - if (LocNoVec.size() < 64) { - LocNoCount = LocNoVec.size(); - if (LocNoCount > 0) { - LocNos = std::make_unique<unsigned[]>(LocNoCount); - std::copy(LocNoVec.begin(), LocNoVec.end(), loc_nos_begin()); - } - } else { - LLVM_DEBUG(dbgs() << "Found debug value with 64+ unique machine " - "locations, dropping...\n"); - LocNoCount = 1; - // Turn this into an undef debug value list; right now, the simplest form - // of this is an expression with one arg, and an undef debug operand. - Expression = - DIExpression::get(Expr.getContext(), {dwarf::DW_OP_LLVM_arg, 0, - dwarf::DW_OP_stack_value}); - if (auto FragmentInfoOpt = Expr.getFragmentInfo()) - Expression = *DIExpression::createFragmentExpression( - Expression, FragmentInfoOpt->OffsetInBits, - FragmentInfoOpt->SizeInBits); - LocNos = std::make_unique<unsigned[]>(LocNoCount); - LocNos[0] = UndefLocNo; + // A debug value referencing 64+ unique machine locations is very likely + // to be the result of a bug earlier in the pipeline. If by some means this + // limit is validly reached, then we can add a byte to the size of + // LocNoCount. + assert(LocNoVec.size() < 64 && + "debug value containing 64+ unique machine locations is not " + "supported by Live Debug Variables"); + LocNoCount = LocNoVec.size(); + if (LocNoCount > 0) { + LocNos.reset(new unsigned[LocNoCount]()); + std::copy(LocNoVec.begin(), LocNoVec.end(), loc_nos_begin()); } } |