diff options
author | OCHyams <orlando.hyams@sony.com> | 2022-11-23 13:32:53 +0000 |
---|---|---|
committer | OCHyams <orlando.hyams@sony.com> | 2022-11-23 13:56:34 +0000 |
commit | 7707d4913b6adf9d411ff5ab5fa449dff2dd76b0 (patch) | |
tree | 6dab78f004f2382cf5cd5fa3ae12197648e3d456 /llvm/lib/IR/IntrinsicInst.cpp | |
parent | cb0d2887ab8f54f8dea72149904468f61cfc0d5b (diff) | |
download | llvm-7707d4913b6adf9d411ff5ab5fa449dff2dd76b0.zip llvm-7707d4913b6adf9d411ff5ab5fa449dff2dd76b0.tar.gz llvm-7707d4913b6adf9d411ff5ab5fa449dff2dd76b0.tar.bz2 |
[Assignment Tracking] Fix DbgVariableIntrinsic::replaceVariableLocationOp
Fix replaceVariableLocationOp unconditionally replacing the first operand of a
dbg.assign.
Reviewed By: jryans
Differential Revision: https://reviews.llvm.org/D138561
Diffstat (limited to 'llvm/lib/IR/IntrinsicInst.cpp')
-rw-r--r-- | llvm/lib/IR/IntrinsicInst.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/IR/IntrinsicInst.cpp b/llvm/lib/IR/IntrinsicInst.cpp index b6537b2..f91b148 100644 --- a/llvm/lib/IR/IntrinsicInst.cpp +++ b/llvm/lib/IR/IntrinsicInst.cpp @@ -130,6 +130,11 @@ void DbgVariableIntrinsic::replaceVariableLocationOp(Value *OldValue, assert((OldIt != Locations.end() || DbgAssignAddrReplaced) && "OldValue must be a current location"); if (!hasArgList()) { + // Additional check necessary to avoid unconditionally replacing this + // operand when a dbg.assign address is replaced (DbgAssignAddrReplaced is + // true). + if (OldValue != getVariableLocationOp(0)) + return; Value *NewOperand = isa<MetadataAsValue>(NewValue) ? NewValue : MetadataAsValue::get( |