[PATCH] D69617: [LoopUnroll] countToEliminateCompares(): fix handling of [in]equality predicates (PR43840)
Roman Lebedev via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 6 04:02:33 PST 2019
lebedev.ri added inline comments.
================
Comment at: llvm/lib/Transforms/Utils/LoopUnrollPeel.cpp:267
+ SE.isKnownPredicate(Pred, NextIterVal, RightSCEV) &&
+ !SE.isKnownPredicate(ICmpInst::getInversePredicate(Pred), NextIterVal,
+ RightSCEV)) {
----------------
fhahn wrote:
> I think we don't need to check the inverse predicate is known, when we already know the regular predicate is known, which is the previous check. Similarly, we already know know `SE.isKnownPredicate(ICmpInst::getInversePredicate(Pred), IterVal, RightSCEV)`, so we should not need to check `!SE.isKnownPredicate(Pred, IterVal, RightSCEV) `
>
> It might be worth having those 2 as an assertion though, in case I am missing something.
This is indeed a mess.
I believe this is what you had in mind?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D69617/new/
https://reviews.llvm.org/D69617
More information about the llvm-commits
mailing list