Mesa (master): nir: always attempt to find loop terminators

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Aug 29 06:02:19 UTC 2018


Module: Mesa
Branch: master
Commit: fef6325e587173f2146a8aab75847144d2f802ff
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=fef6325e587173f2146a8aab75847144d2f802ff

Author: Timothy Arceri <tarceri at itsqueeze.com>
Date:   Sat Jul  7 12:02:08 2018 +1000

nir: always attempt to find loop terminators

This will help later patches with unrolling loops that end with a
break i.e. loops the always exit on their first interation.

Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>

---

 src/compiler/nir/nir_loop_analyze.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/compiler/nir/nir_loop_analyze.c b/src/compiler/nir/nir_loop_analyze.c
index d564296aa6..5454b7691b 100644
--- a/src/compiler/nir/nir_loop_analyze.c
+++ b/src/compiler/nir/nir_loop_analyze.c
@@ -717,13 +717,6 @@ get_loop_info(loop_info_state *state, nir_function_impl *impl)
       }
    }
 
-   /* Induction analysis needs invariance information so get that first */
-   compute_invariance_information(state);
-
-   /* We have invariance information so try to find induction variables */
-   if (!compute_induction_information(state))
-      return;
-
    /* Try to find all simple terminators of the loop. If we can't find any,
     * or we find possible terminators that have side effects then bail.
     */
@@ -737,6 +730,13 @@ get_loop_info(loop_info_state *state, nir_function_impl *impl)
       return;
    }
 
+   /* Induction analysis needs invariance information so get that first */
+   compute_invariance_information(state);
+
+   /* We have invariance information so try to find induction variables */
+   if (!compute_induction_information(state))
+      return;
+
    /* Run through each of the terminators and try to compute a trip-count */
    find_trip_count(state);
 




More information about the mesa-commit mailing list