[LVI] Fix the type when inferring nonnull from a dereferenceable attribute bundle#177562
[LVI] Fix the type when inferring nonnull from a dereferenceable attribute bundle#177562philnik777 merged 1 commit intollvm:mainfrom
Conversation
|
@llvm/pr-subscribers-llvm-analysis Author: Nikolas Klauser (philnik777) ChangesFull diff: https://github.com/llvm/llvm-project/pull/177562.diff 1 Files Affected:
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:
|
|
I think this should fix #176734 (comment), but I'm not sure how to test this. Any hints would be appreciated. |
I'm not sure it's worthwhile to track down when exactly the type ends up mattering, but something we could do instead is to add an additional consistency assertion to make sure that the type of the value and the type of the value lattice (for constant lattice values) match somewhere. |
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/88/builds/19768 Here is the relevant piece of the build log for the reference |
No description provided.