[PATCH] D109676: [HardwareLoops] put +1 for loop count before zero extension

ChenZheng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 14 06:00:07 PDT 2021


shchenz added a comment.

In D109676#3060697 <https://reviews.llvm.org/D109676#3060697>, @lebedev.ri wrote:

> Can't you teach `SCEV::getAddExpr()` that? (to fold `zext(x)+C` to `zext(x+C)` iff that doesn't alter the result: https://alive2.llvm.org/ce/z/5ZQ_X_)

To prove `zext(x)+C` not overflow, we need to pass a parameter for a specific loop to `SCEV::getAddExpr()`, will it be a little strange? `AddExpr` should not be connected with any loop.

If you still think this is a requirement, I'd be happy to do this refactor in another patch.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D109676



More information about the llvm-commits mailing list