diff options
author | OCHyams <orlando.hyams@sony.com> | 2023-01-11 16:40:34 +0000 |
---|---|---|
committer | OCHyams <orlando.hyams@sony.com> | 2023-01-12 09:46:01 +0000 |
commit | 83f7f86e7d4d122f0e8e1f7f497a2c8705ae2483 (patch) | |
tree | 7f9e1d7efc1a5f702a990a97150cbd9c86db71a5 /llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp | |
parent | 840edd8ab2620a52e9acbef7de037c9f465dfce7 (diff) | |
download | llvm-83f7f86e7d4d122f0e8e1f7f497a2c8705ae2483.zip llvm-83f7f86e7d4d122f0e8e1f7f497a2c8705ae2483.tar.gz llvm-83f7f86e7d4d122f0e8e1f7f497a2c8705ae2483.tar.bz2 |
[NFC][Assignment Tracking] Add is/setKillAddress
Unlike D140903 this patch folds in treating an empty metadata address component
of a dbg.assign the same as undef because it was already being treated that way
in the AssignmentTrackingAnalysis pass.
Reviewed By: scott.linder
Differential Revision: https://reviews.llvm.org/D141125
Diffstat (limited to 'llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp')
-rw-r--r-- | llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp b/llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp index f553da4..bf421a40 100644 --- a/llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp +++ b/llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp @@ -1263,7 +1263,11 @@ void AssignmentTrackingLowering::emitDbgValue( const auto *DAI = cast<DbgAssignIntrinsic>(Source); // Check the address hasn't been dropped (e.g. the debug uses may not have // been replaced before deleting a Value). - if (Value *Val = DAI->getAddress()) { + if (DAI->isKillAddress()) { + // The address isn't valid so treat this as a non-memory def. + Kind = LocKind::Val; + } else { + Value *Val = DAI->getAddress(); DIExpression *Expr = DAI->getAddressExpression(); assert(!Expr->getFragmentInfo() && "fragment info should be stored in value-expression only"); @@ -1279,9 +1283,6 @@ void AssignmentTrackingLowering::emitDbgValue( walkToAllocaAndPrependOffsetDeref(Layout, Val, Expr); Emit(Val, Expr); return; - } else { - // The address isn't valid so treat this as a non-memory def. - Kind = LocKind::Val; } } @@ -1483,11 +1484,10 @@ void AssignmentTrackingLowering::processDbgAssign(DbgAssignIntrinsic &DAI, // that an assignment happened here, and we know that specific assignment // was the last one to take place in memory for this variable. LocKind Kind; - if (isa<UndefValue>(DAI.getAddress())) { - // Address may be undef to indicate that although the store does take - // place, this part of the original store has been elided. + if (DAI.isKillAddress()) { LLVM_DEBUG( - dbgs() << "Val, Stack matches Debug program but address is undef\n";); + dbgs() + << "Val, Stack matches Debug program but address is killed\n";); Kind = LocKind::Val; } else { LLVM_DEBUG(dbgs() << "Mem, Stack matches Debug program\n";); |