summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2011-11-08 21:08:02 +0000
committerEli Friedman <eli.friedman@gmail.com>2011-11-08 21:08:02 +0000
commit7781ae5be570940178295f6f808215089a3fe411 (patch)
treefce0455fcad8f8ac3c0124f4a8c9c0f1c9cfae3e /lib
parente1b3e11c15b705ad55c5ff2b04a0b790599013ea (diff)
downloadllvm-7781ae5be570940178295f6f808215089a3fe411.tar.gz
llvm-7781ae5be570940178295f6f808215089a3fe411.tar.bz2
llvm-7781ae5be570940178295f6f808215089a3fe411.tar.xz
Fix code to match comment. Fixes PR11340, a regression from r143209.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144121 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Analysis/InstructionSimplify.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Analysis/InstructionSimplify.cpp b/lib/Analysis/InstructionSimplify.cpp
index c1416328b7..2f41f72956 100644
--- a/lib/Analysis/InstructionSimplify.cpp
+++ b/lib/Analysis/InstructionSimplify.cpp
@@ -1612,7 +1612,7 @@ static Value *SimplifyICmpInst(unsigned Predicate, Value *LHS, Value *RHS,
Lower = (-Upper) + 1;
} else if (match(LHS, m_UDiv(m_ConstantInt(CI2), m_Value()))) {
// 'udiv CI2, x' produces [0, CI2].
- Upper = CI2->getValue();
+ Upper = CI2->getValue() + 1;
} else if (match(LHS, m_UDiv(m_Value(), m_ConstantInt(CI2)))) {
// 'udiv x, CI2' produces [0, UINT_MAX / CI2].
APInt NegOne = APInt::getAllOnesValue(Width);