[PATCH] D35347: [IRCE] Fix corner case with Start = INT_MAX
Max Kazantsev via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 13 01:55:16 PDT 2017
mkazantsev created this revision.
When iterating through loop
for (int i = INT_MAX; i > 0; i--)
We fail to generate the pre-loop for it. It happens because we use the overflown value
in a comparison predicate when identifying whether or not we need it.
In old logic, we used SLE predicate against Greatest value which exceeds all seen values
of the IV and might be overflown. Now we use the GreatestSeen value of this IV with SLT
predicate.
Also added a test that ensures that a pre-loop is generated for such loops.
https://reviews.llvm.org/D35347
Files:
lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp
test/Transforms/IRCE/pre_post_loops.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D35347.106383.patch
Type: text/x-patch
Size: 3587 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170713/e31cbd5d/attachment.bin>
More information about the llvm-commits
mailing list