Skip to content

Commit 7476252

Browse files
committed
[SelectionDAG] Use poison instead of undef for dbg.values
`undef dbg.values` can be replaced with `poison dbg.values`.
1 parent 0fe0968 commit 7476252

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1385,12 +1385,12 @@ static bool handleDanglingVariadicDebugInfo(SelectionDAG &DAG,
13851385
DebugLoc DL, unsigned Order,
13861386
SmallVectorImpl<Value *> &Values,
13871387
DIExpression *Expression) {
1388-
// For variadic dbg_values we will now insert an undef.
1388+
// For variadic dbg_values we will now insert poison.
13891389
// FIXME: We can potentially recover these!
13901390
SmallVector<SDDbgOperand, 2> Locs;
13911391
for (const Value *V : Values) {
1392-
auto *Undef = UndefValue::get(V->getType());
1393-
Locs.push_back(SDDbgOperand::fromConst(Undef));
1392+
auto *Poison = PoisonValue::get(V->getType());
1393+
Locs.push_back(SDDbgOperand::fromConst(Poison));
13941394
}
13951395
SDDbgValue *SDV = DAG.getDbgValueList(Variable, Expression, Locs, {},
13961396
/*IsIndirect=*/false, DL, Order,
@@ -1409,9 +1409,9 @@ void SelectionDAGBuilder::addDanglingDebugInfo(SmallVectorImpl<Value *> &Values,
14091409
return;
14101410
}
14111411
// TODO: Dangling debug info will eventually either be resolved or produce
1412-
// an Undef DBG_VALUE. However in the resolution case, a gap may appear
1412+
// a poison DBG_VALUE. However in the resolution case, a gap may appear
14131413
// between the original dbg.value location and its resolved DBG_VALUE,
1414-
// which we should ideally fill with an extra Undef DBG_VALUE.
1414+
// which we should ideally fill with an extra poison DBG_VALUE.
14151415
assert(Values.size() == 1);
14161416
DanglingDebugInfoMap[Values[0]].emplace_back(Var, Expr, DL, Order);
14171417
}
@@ -1489,9 +1489,9 @@ void SelectionDAGBuilder::resolveDanglingDebugInfo(const Value *V,
14891489
} else {
14901490
LLVM_DEBUG(dbgs() << "Dropping debug info for " << printDDI(V, DDI)
14911491
<< "\n");
1492-
auto Undef = UndefValue::get(V->getType());
1492+
auto Poison = PoisonValue::get(V->getType());
14931493
auto SDV =
1494-
DAG.getConstantDbgValue(Variable, Expr, Undef, DL, DbgSDNodeOrder);
1494+
DAG.getConstantDbgValue(Variable, Expr, Poison, DL, DbgSDNodeOrder);
14951495
DAG.AddDbgValue(SDV, false);
14961496
}
14971497
}
@@ -1554,11 +1554,11 @@ void SelectionDAGBuilder::salvageUnresolvedDbgValue(const Value *V,
15541554
}
15551555

15561556
// This was the final opportunity to salvage this debug information, and it
1557-
// couldn't be done. Place an undef DBG_VALUE at this location to terminate
1557+
// couldn't be done. Place a poison DBG_VALUE at this location to terminate
15581558
// any earlier variable location.
15591559
assert(OrigV && "V shouldn't be null");
1560-
auto *Undef = UndefValue::get(OrigV->getType());
1561-
auto *SDV = DAG.getConstantDbgValue(Var, Expr, Undef, DL, SDNodeOrder);
1560+
auto *Poison = PoisonValue::get(OrigV->getType());
1561+
auto *SDV = DAG.getConstantDbgValue(Var, Expr, Poison, DL, SDNodeOrder);
15621562
DAG.AddDbgValue(SDV, false);
15631563
LLVM_DEBUG(dbgs() << "Dropping debug value info for:\n "
15641564
<< printDDI(OrigV, DDI) << "\n");
@@ -6180,10 +6180,10 @@ bool SelectionDAGBuilder::EmitFuncArgumentDbgValue(
61806180
Expr, Offset, RegFragmentSizeInBits);
61816181
Offset += RegAndSize.second;
61826182
// If a valid fragment expression cannot be created, the variable's
6183-
// correct value cannot be determined and so it is set as Undef.
6183+
// correct value cannot be determined and so it is set as poison.
61846184
if (!FragmentExpr) {
61856185
SDDbgValue *SDV = DAG.getConstantDbgValue(
6186-
Variable, Expr, UndefValue::get(V->getType()), DL, SDNodeOrder);
6186+
Variable, Expr, PoisonValue::get(V->getType()), DL, SDNodeOrder);
61876187
DAG.AddDbgValue(SDV, false);
61886188
continue;
61896189
}

0 commit comments

Comments
 (0)