aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/LazyValueInfo.cpp
diff options
context:
space:
mode:
authorArtur Pilipenko <apilipenko@azulsystems.com>2016-08-08 14:13:56 +0000
committerArtur Pilipenko <apilipenko@azulsystems.com>2016-08-08 14:13:56 +0000
commit54b50cc1a84b847a01ccda6e31080ecd7d42c2df (patch)
tree4e637635d83bf5b37b176feb97ffefb2f60f8b82 /llvm/lib/Analysis/LazyValueInfo.cpp
parent21472910c101f169d4cd364e474120049dbd801b (diff)
downloadllvm-54b50cc1a84b847a01ccda6e31080ecd7d42c2df.zip
llvm-54b50cc1a84b847a01ccda6e31080ecd7d42c2df.tar.gz
llvm-54b50cc1a84b847a01ccda6e31080ecd7d42c2df.tar.bz2
[LVI] NFC. Rename confusing local NegOffset to Offset
NegOffset is not necessarily negative llvm-svn: 278008
Diffstat (limited to 'llvm/lib/Analysis/LazyValueInfo.cpp')
-rw-r--r--llvm/lib/Analysis/LazyValueInfo.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/llvm/lib/Analysis/LazyValueInfo.cpp b/llvm/lib/Analysis/LazyValueInfo.cpp
index 306a1cf..c65c81d 100644
--- a/llvm/lib/Analysis/LazyValueInfo.cpp
+++ b/llvm/lib/Analysis/LazyValueInfo.cpp
@@ -1199,20 +1199,20 @@ bool getValueFromCondition(Value *Val, Value *Cond, LVILatticeVal &Result,
}
// Recognize the range checking idiom that InstCombine produces.
- // (X-C1) u< C2 --> [C1, C1+C2)
- ConstantInt *NegOffset = nullptr;
+ // (X+C1) u< C2 --> [-C1, C2-C1)
+ ConstantInt *Offset = nullptr;
if (Predicate == ICmpInst::ICMP_ULT)
- match(LHS, m_Add(m_Specific(Val), m_ConstantInt(NegOffset)));
+ match(LHS, m_Add(m_Specific(Val), m_ConstantInt(Offset)));
ConstantInt *CI = dyn_cast<ConstantInt>(RHS);
- if (CI && (LHS == Val || NegOffset)) {
+ if (CI && (LHS == Val || Offset)) {
// Calculate the range of values that are allowed by the comparison
ConstantRange CmpRange(CI->getValue());
ConstantRange TrueValues =
ConstantRange::makeAllowedICmpRegion(Predicate, CmpRange);
- if (NegOffset) // Apply the offset from above.
- TrueValues = TrueValues.subtract(NegOffset->getValue());
+ if (Offset) // Apply the offset from above.
+ TrueValues = TrueValues.subtract(Offset->getValue());
// If we're interested in the false dest, invert the condition.
if (!isTrueDest) TrueValues = TrueValues.inverse();