mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-10-19 11:02:59 +02:00
Fix code to match comment. Fixes PR11340, a regression from r143209.
llvm-svn: 144121
This commit is contained in:
parent
4cc5284596
commit
6bda990650
@ -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);
|
||||
|
@ -342,6 +342,16 @@ define i1 @udiv5(i32 %X) {
|
||||
; CHECK: ret i1 false
|
||||
}
|
||||
|
||||
; PR11340
|
||||
define i1 @udiv6(i32 %X) nounwind {
|
||||
; CHECK: @udiv6
|
||||
%A = udiv i32 1, %X
|
||||
%C = icmp eq i32 %A, 0
|
||||
ret i1 %C
|
||||
; CHECK: ret i1 %C
|
||||
}
|
||||
|
||||
|
||||
define i1 @sdiv1(i32 %X) {
|
||||
; CHECK: @sdiv1
|
||||
%A = sdiv i32 %X, 1000000
|
||||
|
Loading…
Reference in New Issue
Block a user