[Mesa-dev] Partial loop unrolling support v2

Timothy Arceri tarceri at itsqueeze.com
Tue Nov 20 08:14:28 UTC 2018


This series add support for partial loop unrolling for loops with an
unknown trip count. The new partial_unroll function allows the caller
to specifiy how may times the loop should be unrolled and then the
loop is inserted in the innermost continue branch of the unrolled loop.

For now we only do partial unrolling for loops where we can guess the
iteration count based on array access that uses an induction variable
as its index (see patch 7).

Patches 1-6 are tidy-ups/refactors.

Patch 7 adds a method for guessing the trip count for the loop.

Patch 8-9 add partial unrolling support and also support for removing
redundant load/stores from the remaining loop when considering if
we would be accessing an array out bounds. Eliminating these out of
bounds accesses allows the loop to be completely removed in
some cases.

Patch 10-11 are support for full unrolling of some loops pointed
out to me by Jason.

v2: 
- added patch 2 to clarify some loop info member names and hopefully
  make the code easier to follow now that the number of unrolling
  scenarios are growing.
- added patches 10-11 these do full unrolling rather than partial
  unrolling but make use of some of the refactors done by this series.




More information about the mesa-dev mailing list