[llvm] [LVI] Fix the type when inferring nonnull from a dereferenceable attribute bundle (PR #177562)

Nikolas Klauser via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 23 02:21:45 PST 2026


https://github.com/philnik777 created https://github.com/llvm/llvm-project/pull/177562

None

>From a50096bcb6c3bd6d8e2f4ed8d136ab112cbffd3e Mon Sep 17 00:00:00 2001
From: Nikolas Klauser <nikolasklauser at berlin.de>
Date: Fri, 23 Jan 2026 11:21:15 +0100
Subject: [PATCH] [LVI] Fix the type when inferring nonnull from a
 dereferenceable attribute bundle

---
 llvm/lib/Analysis/LazyValueInfo.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/llvm/lib/Analysis/LazyValueInfo.cpp b/llvm/lib/Analysis/LazyValueInfo.cpp
index 0bdd158970dc7..b4d64536a5aca 100644
--- a/llvm/lib/Analysis/LazyValueInfo.cpp
+++ b/llvm/lib/Analysis/LazyValueInfo.cpp
@@ -854,7 +854,7 @@ void LazyValueInfoImpl::intersectAssumeOrGuardBlockValueConstantRange(
           if (auto *CI = dyn_cast<ConstantInt>(RK.IRArgValue);
               CI && !CI->isZero())
             BBLV = BBLV.intersect(ValueLatticeElement::getNot(
-                Constant::getNullValue(RK.IRArgValue->getType())));
+                Constant::getNullValue(RK.WasOn->getType())));
           break;
 
         default:



More information about the llvm-commits mailing list