[PATCH] D25682: [LoopUnroll] Keep the loop test only on the first iteration of max-or-zero loops
John Brawn via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 17 09:09:25 PDT 2016
john.brawn created this revision.
john.brawn added reviewers: sanjoy, christof, haicheng, mzolotukhin.
john.brawn added a subscriber: llvm-commits.
john.brawn set the repository for this revision to rL LLVM.
When we have a loop with a known upper bound on the number of iterations, and furthermore know that either the number of iterations will be either exactly that upper bound or zero, then we can fully unroll up to that upper bound keeping only the first loop test to check for the zero iteration case.
Most of the work here is in plumbing this 'max-or-zero' information from the part of scalar evolution where it's detected through to loop unrolling. I've also gone for the safe default of 'false' everywhere but howManyLessThans which could probably be improved.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 28857 bytes
Desc: not available
More information about the llvm-commits