llvm.org GIT mirror llvm / 7781ae5
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 Eli Friedman 7 years ago
2 changed file(s) with 11 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
16111611 Lower = (-Upper) + 1;
16121612 } else if (match(LHS, m_UDiv(m_ConstantInt(CI2), m_Value()))) {
16131613 // 'udiv CI2, x' produces [0, CI2].
1614 Upper = CI2->getValue();
1614 Upper = CI2->getValue() + 1;
16151615 } else if (match(LHS, m_UDiv(m_Value(), m_ConstantInt(CI2)))) {
16161616 // 'udiv x, CI2' produces [0, UINT_MAX / CI2].
16171617 APInt NegOne = APInt::getAllOnesValue(Width);
341341 ; CHECK: ret i1 false
342342 }
343343
344 ; PR11340
345 define i1 @udiv6(i32 %X) nounwind {
346 ; CHECK: @udiv6
347 %A = udiv i32 1, %X
348 %C = icmp eq i32 %A, 0
349 ret i1 %C
350 ; CHECK: ret i1 %C
351 }
352
353
344354 define i1 @sdiv1(i32 %X) {
345355 ; CHECK: @sdiv1
346356 %A = sdiv i32 %X, 1000000