diff options
author | Stephen Tozer <Stephen.Tozer@Sony.com> | 2021-05-20 20:17:33 +0100 |
---|---|---|
committer | Stephen Tozer <Stephen.Tozer@Sony.com> | 2021-05-21 11:06:20 +0100 |
commit | 36ec97f76ac0d8be76fb16ac521f55126766267d (patch) | |
tree | 9d3136fa7fa260f6def0c6545b7cb1967b3fc76a /llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp | |
parent | 5a476987f7d653eb7ce2d8ba0ddf0125f481117e (diff) | |
download | llvm-36ec97f76ac0d8be76fb16ac521f55126766267d.zip llvm-36ec97f76ac0d8be76fb16ac521f55126766267d.tar.gz llvm-36ec97f76ac0d8be76fb16ac521f55126766267d.tar.bz2 |
3rd Reapply "[DebugInfo] Use variadic debug values to salvage BinOps and GEP instrs with non-const operands"
This reapplies c0f3dfb9, which was reverted following the discovery of
crashes on linux kernel and chromium builds - these issues have since
been fixed, allowing this patch to re-land.
This reverts commit 4397b7095d640f9b9426c4d0135e999c5a1de1c5.
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp index c69f741..12b7b57 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp @@ -1247,6 +1247,10 @@ void SelectionDAGBuilder::resolveDanglingDebugInfo(const Value *V, } void SelectionDAGBuilder::salvageUnresolvedDbgValue(DanglingDebugInfo &DDI) { + // TODO: For the variadic implementation, instead of only checking the fail + // state of `handleDebugValue`, we need know specifically which values were + // invalid, so that we attempt to salvage only those values when processing + // a DIArgList. assert(!DDI.getDI()->hasArgList() && "Not implemented for variadic dbg_values"); Value *V = DDI.getDI()->getValue(0); @@ -1270,16 +1274,21 @@ void SelectionDAGBuilder::salvageUnresolvedDbgValue(DanglingDebugInfo &DDI) { while (isa<Instruction>(V)) { Instruction &VAsInst = *cast<Instruction>(V); // Temporary "0", awaiting real implementation. - DIExpression *NewExpr = salvageDebugInfoImpl(VAsInst, Expr, StackValue, 0); + SmallVector<Value *, 4> AdditionalValues; + DIExpression *SalvagedExpr = + salvageDebugInfoImpl(VAsInst, Expr, StackValue, 0, AdditionalValues); // If we cannot salvage any further, and haven't yet found a suitable debug // expression, bail out. - if (!NewExpr) + // TODO: If AdditionalValues isn't empty, then the salvage can only be + // represented with a DBG_VALUE_LIST, so we give up. When we have support + // here for variadic dbg_values, remove that condition. + if (!SalvagedExpr || !AdditionalValues.empty()) break; // New value and expr now represent this debuginfo. V = VAsInst.getOperand(0); - Expr = NewExpr; + Expr = SalvagedExpr; // Some kind of simplification occurred: check whether the operand of the // salvaged debug expression can be encoded in this DAG. |