nir: add guess trip count support to loop analysis
authorTimothy Arceri <tarceri@itsqueeze.com>
Thu, 15 Nov 2018 12:23:09 +0000 (23:23 +1100)
committerTimothy Arceri <tarceri@itsqueeze.com>
Tue, 12 Mar 2019 00:52:30 +0000 (00:52 +0000)
commit03a452b7d099b1d12b702a6d321431dbf039141b
treeeb44b6e299402321a71e898aabd183a38a33e65a
parent97f2d04d5eb93731700c1941c811bb354d057cfc
nir: add guess trip count support to loop analysis

This detects an induction variable used as an array index to guess
the trip count of the loop. This enables us to do a partial
unroll of the loop, which can eventually result in the loop being
eliminated.

v2: check if the induction var is used to index more than a single
    array and if so get the size of the smallest array.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/compiler/nir/nir.h
src/compiler/nir/nir_loop_analyze.c