[PATCH] D34979: [IndVars] Canonicalize comparisons between non-negative values and indvars

Sanjoy Das via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 4 13:15:39 PDT 2017


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

lgtm



================
Comment at: lib/Transforms/Utils/SimplifyIndVar.cpp:265
     ICmp->setOperand(1, NewRHS);
+  } else if (Pred != ICmpInst::getUnsignedPredicate(Pred) &&
+             SE->isKnownNonNegative(S) && SE->isKnownNonNegative(X)) {
----------------
I think writing the first part as `ICmpInst::isSigned(Pred)` would be clearer.


https://reviews.llvm.org/D34979





More information about the llvm-commits mailing list