[PATCH] Teach ScalarEvolution to sharpen range information.
Andrew Trick
atrick at apple.com
Tue Oct 14 20:25:07 PDT 2014
There are a couple obvious typos. Please make sure those are fixed to match your intentions.
Otherwise, I think this is fine. I have to admit I had to stare at it for quite some time to understand what's going on, but it does seem like a decent fix for your reasonable test case.
[off the subject of the review a bit]
In general, as we continue piling logic into SCEV I would encourage you to at least run some basic compile-time measurements. One way to do this is to link a bunch of IR files together and run opt -O2 -time-passes.
================
Comment at: lib/Analysis/ScalarEvolution.cpp:6531
@@ +6530,3 @@
+ // If we are predicated on something with range [a, b) and known
+ // not equal to a or b, our range effectively is [a + 1, b). Use
+ // this fact.
----------------
You mean "not equal to a"?
================
Comment at: lib/Analysis/ScalarEvolution.cpp:6552
@@ +6551,3 @@
+ return isImpliedCondOperands(Pred, LHS, RHS, V, getConstant(Min));
+ return isImpliedCondOperands(Pred, LHS, RHS, V, getConstant(Min));
+
----------------
Why is this line pasted twice?
http://reviews.llvm.org/D5639
More information about the llvm-commits
mailing list