Skip to content

Commit 6ab663b

Browse files
committed
[LVI] Require UndefAllowed argument to getConstantRangeAtUse() (NFC)
For the remaining uses set it to true, matching the current behavior.
1 parent 5ee0881 commit 6ab663b

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

llvm/include/llvm/Analysis/LazyValueInfo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ namespace llvm {
9999

100100
/// Return the ConstantRange constraint that is known to hold for the value
101101
/// at a specific use-site.
102-
ConstantRange getConstantRangeAtUse(const Use &U, bool UndefAllowed = true);
102+
ConstantRange getConstantRangeAtUse(const Use &U, bool UndefAllowed);
103103

104104
/// Determine whether the specified value is known to be a
105105
/// constant on the specified edge. Return null if not.

llvm/lib/Transforms/Scalar/CorrelatedValuePropagation.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,8 +278,10 @@ static bool processICmp(ICmpInst *Cmp, LazyValueInfo *LVI) {
278278
ICmpInst::Predicate UnsignedPred =
279279
ConstantRange::getEquivalentPredWithFlippedSignedness(
280280
Cmp->getPredicate(),
281-
LVI->getConstantRangeAtUse(Cmp->getOperandUse(0)),
282-
LVI->getConstantRangeAtUse(Cmp->getOperandUse(1)));
281+
LVI->getConstantRangeAtUse(Cmp->getOperandUse(0),
282+
/*UndefAllowed*/ true),
283+
LVI->getConstantRangeAtUse(Cmp->getOperandUse(1),
284+
/*UndefAllowed*/ true));
283285

284286
if (UnsignedPred == ICmpInst::Predicate::BAD_ICMP_PREDICATE)
285287
return false;

0 commit comments

Comments
 (0)