[llvm] [ValueTracking][NFC] Drop outdated TODO in canCreateUndefOrPoison (PR #139915)

Cullen Rhodes via llvm-commits llvm-commits at lists.llvm.org
Thu May 15 06:02:03 PDT 2025


https://github.com/c-rhodes updated https://github.com/llvm/llvm-project/pull/139915

>From 5d95e8a6a6e09cff7f40685024bc08ab6a182681 Mon Sep 17 00:00:00 2001
From: Cullen Rhodes <cullen.rhodes at arm.com>
Date: Wed, 14 May 2025 14:37:15 +0000
Subject: [PATCH 1/2] [ValueTracking][NFC] Drop outdated TODO in
 canCreateUndefOrPoison

The inrange constexpr GEP case is handled since 425cbbc602c9.
---
 llvm/lib/Analysis/ValueTracking.cpp | 2 --
 1 file changed, 2 deletions(-)

diff --git a/llvm/lib/Analysis/ValueTracking.cpp b/llvm/lib/Analysis/ValueTracking.cpp
index 3d403531cea2f..e5203baac39b7 100644
--- a/llvm/lib/Analysis/ValueTracking.cpp
+++ b/llvm/lib/Analysis/ValueTracking.cpp
@@ -7788,8 +7788,6 @@ static bool canCreateUndefOrPoison(const Operator *Op, UndefPoisonKind Kind,
   case Instruction::FRem:
     return false;
   case Instruction::GetElementPtr:
-    // inbounds is handled above
-    // TODO: what about inrange on constexpr?
     return false;
   default: {
     const auto *CE = dyn_cast<ConstantExpr>(Op);

>From c9b46c0ef6978e26ecfcdc1840f64e231e73539b Mon Sep 17 00:00:00 2001
From: Cullen Rhodes <cullen.rhodes at arm.com>
Date: Thu, 15 May 2025 13:00:34 +0000
Subject: [PATCH 2/2] address comments

---
 llvm/lib/Analysis/ValueTracking.cpp | 1 -
 1 file changed, 1 deletion(-)

diff --git a/llvm/lib/Analysis/ValueTracking.cpp b/llvm/lib/Analysis/ValueTracking.cpp
index e5203baac39b7..8405678aa9680 100644
--- a/llvm/lib/Analysis/ValueTracking.cpp
+++ b/llvm/lib/Analysis/ValueTracking.cpp
@@ -7786,7 +7786,6 @@ static bool canCreateUndefOrPoison(const Operator *Op, UndefPoisonKind Kind,
   case Instruction::FMul:
   case Instruction::FDiv:
   case Instruction::FRem:
-    return false;
   case Instruction::GetElementPtr:
     return false;
   default: {



More information about the llvm-commits mailing list