[PATCH] D31488: [SimplifyIndvar] Replace the sdiv 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
Thu Mar 30 14:56:44 PDT 2017
sanjoy accepted this revision.
sanjoy added a comment.
This revision is now accepted and ready to land.
lgtm with minor comments
================
Comment at: lib/Transforms/Utils/SimplifyIndVar.cpp:39
+STATISTIC(
+ NumElimSDiv,
+ "Number of IV signed division operations converted to unsigned division");
----------------
s/NumElimSDiv/NumSimplifiedSDiv/
================
Comment at: lib/Transforms/Utils/SimplifyIndVar.cpp:275
+bool SimplifyIndvar::eliminateSDiv(BinaryOperator *SDiv) {
+ // Get the SCEVs for the ICmp operands.
+ auto *N = SE->getSCEV(SDiv->getOperand(0));
----------------
Comment is wrong.
I'd actually just drop the comment. It is obvious enough what the code is doing here.
Repository:
rL LLVM
https://reviews.llvm.org/D31488
More information about the llvm-commits
mailing list