aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/IntrinsicInst.cpp
diff options
context:
space:
mode:
authorCarlos Alberto Enciso <Carlos.Enciso@sony.com>2024-04-26 13:35:09 +0100
committerGitHub <noreply@github.com>2024-04-26 13:35:09 +0100
commit7696d36b4ed595bf9681fd379d1dcbaf30c1ef0a (patch)
treefd92ee1a15187ef9709a3c64cf5f0de4f6a1f111 /llvm/lib/IR/IntrinsicInst.cpp
parentc4c9d4f306732c854fa88d2f30c1a22bb025d0c9 (diff)
downloadllvm-7696d36b4ed595bf9681fd379d1dcbaf30c1ef0a.zip
llvm-7696d36b4ed595bf9681fd379d1dcbaf30c1ef0a.tar.gz
llvm-7696d36b4ed595bf9681fd379d1dcbaf30c1ef0a.tar.bz2
[Transforms] Debug values are not remapped when cloning. (#87747)
When cloning instructions from one basic block to another, the debug values are not remapped, in the same was as the normal instructions.
Diffstat (limited to 'llvm/lib/IR/IntrinsicInst.cpp')
-rw-r--r--llvm/lib/IR/IntrinsicInst.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/IR/IntrinsicInst.cpp b/llvm/lib/IR/IntrinsicInst.cpp
index 8faeb4e..6b6420a 100644
--- a/llvm/lib/IR/IntrinsicInst.cpp
+++ b/llvm/lib/IR/IntrinsicInst.cpp
@@ -119,7 +119,8 @@ static ValueAsMetadata *getAsMetadata(Value *V) {
}
void DbgVariableIntrinsic::replaceVariableLocationOp(Value *OldValue,
- Value *NewValue) {
+ Value *NewValue,
+ bool AllowEmpty) {
// If OldValue is used as the address part of a dbg.assign intrinsic replace
// it with NewValue and return true.
auto ReplaceDbgAssignAddress = [this, OldValue, NewValue]() -> bool {
@@ -136,6 +137,8 @@ void DbgVariableIntrinsic::replaceVariableLocationOp(Value *OldValue,
auto Locations = location_ops();
auto OldIt = find(Locations, OldValue);
if (OldIt == Locations.end()) {
+ if (AllowEmpty || DbgAssignAddrReplaced)
+ return;
assert(DbgAssignAddrReplaced &&
"OldValue must be dbg.assign addr if unused in DIArgList");
return;