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.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Would it be worth adding a C++ unit test for those cases that just passes in suitable predicates + SCEV expression?
Actually I'm not sure we need this. I could not construct a test where it would succeed.
It seems that there is no way that SCEV can now both make this query and return true for it. I'm currently building a chain of patch that will fix the query responds. Hopefully with them we will be able to construct a test for it.
Or can we just merge it basing on obviousness of this logic?
Sure that is fine, if there will be patches to make use of it in the near future.
LGTM, thanks.
llvm/lib/Analysis/ScalarEvolution.cpp | ||
---|---|---|
9763 | nit: Might be good to mention both the LE & LT variants and say that both LHS <= RHS and LHS < RHS are handled in the same way as RHS >= LHS and RHS > LHS respectively. |
llvm/lib/Analysis/ScalarEvolution.cpp | ||
---|---|---|
9763 | Ok. |
Thanks Florian! One example of where it helps is ULT check in test of D88087 (fails without this patch).
nit: Might be good to mention both the LE & LT variants and say that both LHS <= RHS and LHS < RHS are handled in the same way as RHS >= LHS and RHS > LHS respectively.