[PATCH] D93882: [SCEV] recognize logical and/or pattern

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 31 03:03:39 PST 2020


nikic accepted this revision.
nikic added a comment.
This revision is now accepted and ready to land.

LGTM



================
Comment at: llvm/lib/Analysis/ScalarEvolution.cpp:7641
+               !isa<BinaryOperator>(ExitCond) ||
+               (BECC && BECC->getValue()->isNullValue()));
+      }
----------------
This will warn about unused BECC in release builds. There is an `SCEV::isZero()` helper though that checks for SCEVConstant that is zero.

I think you can simplify this whole block to something like:

```
// Make sure that if EL0.ExactNotTaken was zero, BECount is folded to zero,
// to satisfy condition (3) above.
assert(!EL0.ExactNotTaken->isZero() || BECount->isZero())
```


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D93882/new/

https://reviews.llvm.org/D93882



More information about the llvm-commits mailing list