[PATCH] D38072: [SimplifyIndvar] Replace the srem used by IV if we can prove both of its operands are non-negative
Sanjoy Das via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 19 20:56:04 PDT 2017
sanjoy requested changes to this revision.
sanjoy added inline comments.
This revision now requires changes to proceed.
================
Comment at: lib/Transforms/Utils/SimplifyIndVar.cpp:306
+ auto *N = SE->getSCEV(SRem->getOperand(0));
+ auto *D = SE->getSCEV(SRem->getOperand(1));
+
----------------
Instead of creating another function this way, I thin a cleaner design would be to create a couple of small functions for the "i % n --> i if i is in [0,n).", "i+1) % n --> (i+1)==n?0:(i+1) if i is in [0,n)." cases and this case, and call them from SimplifyIndvar::eliminateIVRemainder.
Repository:
rL LLVM
https://reviews.llvm.org/D38072
More information about the llvm-commits
mailing list