diff options
author | Pedro Lobo <pedro.lobo@tecnico.ulisboa.pt> | 2025-03-06 11:30:05 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-03-06 12:30:05 +0100 |
commit | 156cdcf2ffc9a5f851e1b340891172462938b5ea (patch) | |
tree | 22f80933f809bb5a8970774968943d04650e2f3b /llvm/lib/IR/DebugInfo.cpp | |
parent | 20d955ce2aa23373e58ea203e8f399082d61307b (diff) | |
download | llvm-156cdcf2ffc9a5f851e1b340891172462938b5ea.zip llvm-156cdcf2ffc9a5f851e1b340891172462938b5ea.tar.gz llvm-156cdcf2ffc9a5f851e1b340891172462938b5ea.tar.bz2 |
[Assignment Tracking] Replace `undef` debug info with `poison` (#129755)
`undef` debug info can be replaced with `poison` debug info.
Diffstat (limited to 'llvm/lib/IR/DebugInfo.cpp')
-rw-r--r-- | llvm/lib/IR/DebugInfo.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/llvm/lib/IR/DebugInfo.cpp b/llvm/lib/IR/DebugInfo.cpp index cc36b71..cefd6fe 100644 --- a/llvm/lib/IR/DebugInfo.cpp +++ b/llvm/lib/IR/DebugInfo.cpp @@ -2133,8 +2133,8 @@ void at::trackAssignments(Function::iterator Start, Function::iterator End, auto &Ctx = Start->getContext(); auto &Module = *Start->getModule(); - // Undef type doesn't matter, so long as it isn't void. Let's just use i1. - auto *Undef = UndefValue::get(Type::getInt1Ty(Ctx)); + // Poison type doesn't matter, so long as it isn't void. Let's just use i1. + auto *Poison = PoisonValue::get(Type::getInt1Ty(Ctx)); DIBuilder DIB(Module, /*AllowUnresolved*/ false); // Scan the instructions looking for stores to local variables' storage. @@ -2148,9 +2148,9 @@ void at::trackAssignments(Function::iterator Start, Function::iterator End, if (auto *AI = dyn_cast<AllocaInst>(&I)) { // We want to track the variable's stack home from its alloca's // position onwards so we treat it as an assignment (where the stored - // value is Undef). + // value is poison). Info = getAssignmentInfo(DL, AI); - ValueComponent = Undef; + ValueComponent = Poison; DestComponent = AI; } else if (auto *SI = dyn_cast<StoreInst>(&I)) { Info = getAssignmentInfo(DL, SI); @@ -2159,7 +2159,7 @@ void at::trackAssignments(Function::iterator Start, Function::iterator End, } else if (auto *MI = dyn_cast<MemTransferInst>(&I)) { Info = getAssignmentInfo(DL, MI); // May not be able to represent this value easily. - ValueComponent = Undef; + ValueComponent = Poison; DestComponent = MI->getOperand(0); } else if (auto *MI = dyn_cast<MemSetInst>(&I)) { Info = getAssignmentInfo(DL, MI); @@ -2169,7 +2169,7 @@ void at::trackAssignments(Function::iterator Start, Function::iterator End, if (ConstValue && ConstValue->isZero()) ValueComponent = ConstValue; else - ValueComponent = Undef; + ValueComponent = Poison; DestComponent = MI->getOperand(0); } else { // Not a store-like instruction. |