nir: add guess trip count support to loop analysis

Graphics / Mesa 3D Graphics Library / Mesa - Timothy Arceri [itsqueeze.com] - 12 March 2019 00:52 EDT

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.

03a452b7d09 nir: add guess trip count support to loop analysis
src/compiler/nir/nir.h | 4 ++
src/compiler/nir/nir_loop_analyze.c | 88 ++++++++++++++++++++++++++++++++++---
2 files changed, 86 insertions(+), 6 deletions(-)

Upstream: cgit.freedesktop.org


  • Share