[PATCH] D48853: [SCEV] Add zext(C + x + ...) -> D + zext(C-D + x + ...)<nuw> transform

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 17 14:03:07 PDT 2018


efriedma added a comment.

I think if we're going to do this, we need to implement it on top of a SCEV-based known-bits implementation; introducing a separate getZeroExtendExprForValue API is going to lead to weird results if SCEV creates a zero-extend expression for some other reason.

Whether we should do this in general, I'm not really sure.  I mean, yes, I can see how this particular form is a bit more convenient for the load-store vectorizer, but it doesn't seem very general; it seems more intuitive to canonicalize towards reducing the number of AddExprs.  But maybe pulling as much information as possible outside of the zext is generally useful enough to make this worthwhile?

Do you also plan to implement a similar transform for AddRecs? (e.g. `(zext i32 {1,+,2}<%while.body> to i64)`).


Repository:
  rL LLVM

https://reviews.llvm.org/D48853





More information about the llvm-commits mailing list