diff options
author | Stephen Tozer <Stephen.Tozer@Sony.com> | 2021-06-17 16:35:17 +0100 |
---|---|---|
committer | Stephen Tozer <Stephen.Tozer@Sony.com> | 2021-06-24 09:46:38 +0100 |
commit | c72705678c4733c83233b71b66a904cc8a0910e5 (patch) | |
tree | 1ca8fece426a5d042874e2a641fe693ac7c9103c /llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp | |
parent | 2daf11749235f91bd159d62133a4b2adb09dedcb (diff) | |
download | llvm-c72705678c4733c83233b71b66a904cc8a0910e5.zip llvm-c72705678c4733c83233b71b66a904cc8a0910e5.tar.gz llvm-c72705678c4733c83233b71b66a904cc8a0910e5.tar.bz2 |
Partial Reapply "[DebugInfo] Use variadic debug values to salvage BinOps and GEP instrs with non-const operands"
This is a partial reapply of the original commit and the followup commit
that were previously reverted; this reapply also includes a small fix
for a potential source of non-determinism, but also has a small change
to turn off variadic debug value salvaging, to ensure that any future
revert/reapply steps to disable and renable this feature do not risk
causing conflicts.
Differential Revision: https://reviews.llvm.org/D91722
This reverts commit 386b66b2fc297cda121a3cc8a36887a6ecbcfc68.
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 fd576ea..b63246a 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp @@ -1248,6 +1248,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); @@ -1271,16 +1275,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. |