[llvm] [Assignment Tracking] Change placeholder from `undef` to `poison` (PR #119760)

Pedro Lobo via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 12 13:12:11 PST 2024


https://github.com/pedroclobo created https://github.com/llvm/llvm-project/pull/119760

Empty metadata address components of `dbg.assign` can be represented as `poison` values instead of `undef` values.

>From e7ffd08398580f453f23e18737d29c42b11862a0 Mon Sep 17 00:00:00 2001
From: Pedro Lobo <pedro.lobo at tecnico.ulisboa.pt>
Date: Thu, 12 Dec 2024 21:04:41 +0000
Subject: [PATCH] [Assignment Tracking] Change placeholder from `undef` to
 `poison`

Empty metadata address components of `dbg.assign` can be represented as
`poison` values instead of `undef` values.
---
 llvm/lib/IR/IntrinsicInst.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/llvm/lib/IR/IntrinsicInst.cpp b/llvm/lib/IR/IntrinsicInst.cpp
index 002bab8e079e50..79795e5691f865 100644
--- a/llvm/lib/IR/IntrinsicInst.cpp
+++ b/llvm/lib/IR/IntrinsicInst.cpp
@@ -223,12 +223,12 @@ void DbgAssignIntrinsic::setAddress(Value *V) {
 void DbgAssignIntrinsic::setKillAddress() {
   if (isKillAddress())
     return;
-  setAddress(UndefValue::get(getAddress()->getType()));
+  setAddress(PoisonValue::get(getAddress()->getType()));
 }
 
 bool DbgAssignIntrinsic::isKillAddress() const {
   Value *Addr = getAddress();
-  return !Addr || isa<UndefValue>(Addr);
+  return !Addr || isa<PoisonValue>(Addr);
 }
 
 void DbgAssignIntrinsic::setValue(Value *V) {



More information about the llvm-commits mailing list