mirror of
https://github.com/RPCSX/llvm.git
synced 2024-11-28 06:00:28 +00:00
Catch ~x < cst just like ~x < ~y, we currently handle this through
means that are about to disappear. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123515 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
28621cb36f
commit
fdb5b01df4
@ -2284,11 +2284,15 @@ Instruction *InstCombiner::visitICmpInst(ICmpInst &I) {
|
||||
}
|
||||
}
|
||||
|
||||
// ~x < ~y --> y < x
|
||||
{ Value *A, *B;
|
||||
if (match(Op0, m_Not(m_Value(A))) &&
|
||||
match(Op1, m_Not(m_Value(B))))
|
||||
return new ICmpInst(I.getPredicate(), B, A);
|
||||
// ~x < ~y --> y < x
|
||||
// ~x < cst --> ~cst < x
|
||||
if (match(Op0, m_Not(m_Value(A)))) {
|
||||
if (match(Op1, m_Not(m_Value(B))))
|
||||
return new ICmpInst(I.getPredicate(), B, A);
|
||||
if (ConstantInt *RHSC = dyn_cast<ConstantInt>(B))
|
||||
return new ICmpInst(I.getPredicate(), ConstantExpr::getNot(RHSC), A);
|
||||
}
|
||||
|
||||
// (a+b) <u a --> llvm.uadd.with.overflow.
|
||||
// (a+b) <u b --> llvm.uadd.with.overflow.
|
||||
|
Loading…
Reference in New Issue
Block a user