[PATCH] D104702: [LSR] Filter out zero factors. PR50765

Huihui Zhang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 22 10:10:37 PDT 2021


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

Ideally we should reject early when stride is zero, but in this case we won't be able to detect this early since stride zero is in a form of add expression.

  (((3 + (-1 * (74 smax (1 + %tmp3)))<nsw>)<nuw><nsw> * {(-2 + (-2 * (trunc i64 undef to i32))),+,-2}<%bb1>) + ((6 + (-2 * (74 smax (1 + %tmp3))))<nuw> * {(1 + (trunc i64 undef to i32)),+,1}<%bb1>))  // Zero stride as the LHS

After getExactSDiv pull out common factor 2 , then we get an add expression that turn out to be zero.


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

https://reviews.llvm.org/D104702



More information about the llvm-commits mailing list