forked from OSchip/llvm-project
[SCEV] Handle `less` predicates for FoundPred = NE
Currently these predicates are ignored, yet their handling is pretty simple. I could not find a single test where it would actually change something, but it's only because isImpliedCondOperands is not smart enough to prove it further on. Yet the situation when we come there with `less` predicate is pretty common. Differential Revision: https://reviews.llvm.org/D87890 Reviewed By: fhahn
This commit is contained in:
parent
a3d0dce260
commit
e2703c021d
|
@ -9758,8 +9758,23 @@ bool ScalarEvolution::isImpliedCond(ICmpInst::Predicate Pred, const SCEV *LHS,
|
|||
|
||||
if (isImpliedCondOperands(Pred, LHS, RHS, V, getConstant(Min)))
|
||||
return true;
|
||||
break;
|
||||
|
||||
// `LHS < RHS` and `LHS <= RHS` are handled in the same way as `RHS > LHS` and `RHS >= LHS` respectively.
|
||||
case ICmpInst::ICMP_SLE:
|
||||
case ICmpInst::ICMP_ULE:
|
||||
if (isImpliedCondOperands(CmpInst::getSwappedPredicate(Pred), RHS,
|
||||
LHS, V, getConstant(SharperMin)))
|
||||
return true;
|
||||
LLVM_FALLTHROUGH;
|
||||
|
||||
case ICmpInst::ICMP_SLT:
|
||||
case ICmpInst::ICMP_ULT:
|
||||
if (isImpliedCondOperands(CmpInst::getSwappedPredicate(Pred), RHS,
|
||||
LHS, V, getConstant(Min)))
|
||||
return true;
|
||||
break;
|
||||
|
||||
default:
|
||||
// No change
|
||||
break;
|
||||
|
|
Loading…
Reference in New Issue