Reapply "[DebugInfo] Enable variadic debug value salvaging"
authorStephen Tozer <Stephen.Tozer@Sony.com>
Wed, 14 Jul 2021 10:54:38 +0000 (11:54 +0100)
committerStephen Tozer <Stephen.Tozer@Sony.com>
Thu, 15 Jul 2021 11:54:51 +0000 (12:54 +0100)
Reapplied after previous build failures were fixed in 14b62f7e2.

This reverts commit 540b4a5fb31086b6d40735e96e6ec497022107e7.

llvm/lib/Transforms/Utils/Local.cpp
llvm/test/DebugInfo/salvage-duplicate-values.ll
llvm/test/DebugInfo/salvage-gep.ll
llvm/test/DebugInfo/salvage-nonconst-binop.ll

index 86d1ea8..d5e301b 100644 (file)
@@ -1761,11 +1761,7 @@ void llvm::salvageDebugInfoForDbgValues(
     } else if (isa<DbgValueInst>(DII) &&
                DII->getNumVariableLocationOps() + AdditionalValues.size() <=
                    MaxDebugArgs) {
-      // TODO: Uncomment the line below and delete the two beneath it to enable
-      // salvaging of dbg.values with multiple location operands.
-      // DII->addVariableLocationOps(AdditionalValues, SalvagedExpr);
-      Value *Undef = UndefValue::get(I.getOperand(0)->getType());
-      DII->replaceVariableLocationOp(I.getOperand(0), Undef);
+      DII->addVariableLocationOps(AdditionalValues, SalvagedExpr);
     } else {
       // Do not salvage using DIArgList for dbg.addr/dbg.declare, as it is
       // currently only valid for stack value expressions.
index 116af46..1b5366c 100644 (file)
@@ -1,4 +1,3 @@
-; XFAIL: *
 ; RUN: opt %s -dce -S | FileCheck %s
 
 ; Tests the results of salvaging variadic dbg.values that use the same SSA value
index dfb3b53..6c31b0f 100644 (file)
@@ -1,4 +1,3 @@
-; XFAIL: *
 ; RUN: opt %s -dce -S | FileCheck %s
 
 ; Tests the salvaging of GEP instructions, specifically struct indexing and
index f9ee1a6..b470bc1 100644 (file)
@@ -1,4 +1,3 @@
-; XFAIL: *\r
 ; RUN: opt %s -dce -S | FileCheck %s\r
 \r
 ; Tests the salvaging of binary operators that use more than one non-constant\r