[llvm] 65d71ee - [DebugInfo] Replace UndefValue with PoisonValue in DIArgList::handleChangedOperand
via llvm-commits
llvm-commits at lists.llvm.org
Tue Apr 25 08:20:26 PDT 2023
Author: OCHyams
Date: 2023-04-25T16:18:41+01:00
New Revision: 65d71ee3cfa754fe622477a4ac57476cbce9e149
URL: https://github.com/llvm/llvm-project/commit/65d71ee3cfa754fe622477a4ac57476cbce9e149
DIFF: https://github.com/llvm/llvm-project/commit/65d71ee3cfa754fe622477a4ac57476cbce9e149.diff
LOG: [DebugInfo] Replace UndefValue with PoisonValue in DIArgList::handleChangedOperand
This helps towards the effort to remove UndefValue from LLVM.
Related to https://discourse.llvm.org/t/auto-undef-debug-uses-of-a-deleted-value
Reviewed By: nlopes
Differential Revision: https://reviews.llvm.org/D140991
Added:
Modified:
llvm/lib/IR/DebugInfoMetadata.cpp
llvm/test/Transforms/GlobalOpt/deadglobal-diarglist-use.ll
Removed:
################################################################################
diff --git a/llvm/lib/IR/DebugInfoMetadata.cpp b/llvm/lib/IR/DebugInfoMetadata.cpp
index a5da64e59e1d8..667cca3fb5cfd 100644
--- a/llvm/lib/IR/DebugInfoMetadata.cpp
+++ b/llvm/lib/IR/DebugInfoMetadata.cpp
@@ -2093,7 +2093,7 @@ void DIArgList::handleChangedOperand(void *Ref, Metadata *New) {
if (NewVM)
VM = NewVM;
else
- VM = ValueAsMetadata::get(UndefValue::get(VM->getValue()->getType()));
+ VM = ValueAsMetadata::get(PoisonValue::get(VM->getValue()->getType()));
}
}
if (Uniq) {
diff --git a/llvm/test/Transforms/GlobalOpt/deadglobal-diarglist-use.ll b/llvm/test/Transforms/GlobalOpt/deadglobal-diarglist-use.ll
index 4b396928b48e4..f077e0013278d 100644
--- a/llvm/test/Transforms/GlobalOpt/deadglobal-diarglist-use.ll
+++ b/llvm/test/Transforms/GlobalOpt/deadglobal-diarglist-use.ll
@@ -6,7 +6,7 @@
; CHECK-NOT: @s
-; CHECK: call void @llvm.dbg.value(metadata !DIArgList(ptr undef
+; CHECK: call void @llvm.dbg.value(metadata !DIArgList(ptr poison
%struct.S = type { i32 }
More information about the llvm-commits
mailing list