nir/loop_analyze: Refactor detection of limit vars
authorJason Ekstrand <jason@jlekstrand.net>
Mon, 24 Jun 2019 22:33:02 +0000 (17:33 -0500)
committerJason Ekstrand <jason@jlekstrand.net>
Wed, 10 Jul 2019 00:20:59 +0000 (00:20 +0000)
commit0333649e638a38258957fd8b7e0367d73bbc7a80
treef1c2a133ab351cd90f11697acee22b7ef7e94ebc
parent8f7405ed9d473c1729d48c5add4f0d9fe147c75a
nir/loop_analyze: Refactor detection of limit vars

This commit reworks both get_induction_and_limit_vars() and
try_find_trip_count_vars_in_iand to return true on success and not
modify their output parameters on failure.  This makes their callers
significantly simpler.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
src/compiler/nir/nir_loop_analyze.c