llvm.org GIT mirror llvm / e2ee753
Revert broken srem logic from r126991. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127021 91177308-0d34-0410-b5e6-96231b3b80d8 Nick Lewycky 8 years ago
2 changed file(s) with 0 addition(s) and 24 deletion(s). Raw diff Collapse all Expand all
16951695 case ICmpInst::ICMP_NE:
16961696 case ICmpInst::ICMP_ULT:
16971697 case ICmpInst::ICMP_ULE:
1698 return ConstantInt::getTrue(RHS->getContext());
1699 }
1700 }
1701
1702 if (LBO && match(LBO, m_SRem(m_Value(), m_Specific(RHS)))) {
1703 switch (Pred) {
1704 default:
1705 break;
1706 case ICmpInst::ICMP_EQ:
1707 case ICmpInst::ICMP_SGT:
1708 case ICmpInst::ICMP_SGE:
1709 return ConstantInt::getFalse(RHS->getContext());
1710 case ICmpInst::ICMP_NE:
1711 case ICmpInst::ICMP_SLT:
1712 case ICmpInst::ICMP_SLE:
17131698 return ConstantInt::getTrue(RHS->getContext());
17141699 }
17151700 }
252252 ; CHECK: ret i1 false
253253 }
254254
255 define i1 @srem2(i32 %X, i32 %Y) {
256 ; CHECK: @srem2
257 %neg = sub i32 %Y, 0
258 %A = srem i32 %X, %Y
259 %B = icmp slt i32 %A, %neg
260 ret i1 %B
261 ; CHECK: ret i1 true
262 }
263
264255 define i1 @udiv1(i32 %X) {
265256 ; CHECK: @udiv1
266257 %A = udiv i32 %X, 1000000