summaryrefslogtreecommitdiffstats
path: root/src/compiler/nir/nir_loop_analyze.c
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2018-03-26 15:26:21 -0700
committerJason Ekstrand <[email protected]>2018-06-22 21:23:06 -0700
commit9800b81ffb64a863e8a6b29366f32281eb844a53 (patch)
tree59f37fffbb752820994fa0f73ca82879c6a9b066 /src/compiler/nir/nir_loop_analyze.c
parent2db878416799ffeadf5ce3e1b6175d63b5a002e3 (diff)
nir: Remove deref chain support from analyze_loops
Note that this patch needs to come late in the series since this pass can be run after any pass that damages nir_metadata_loop_analysis. Acked-by: Rob Clark <[email protected]> Acked-by: Bas Nieuwenhuizen <[email protected]> Acked-by: Dave Airlie <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/compiler/nir/nir_loop_analyze.c')
-rw-r--r--src/compiler/nir/nir_loop_analyze.c56
1 files changed, 0 insertions, 56 deletions
diff --git a/src/compiler/nir/nir_loop_analyze.c b/src/compiler/nir/nir_loop_analyze.c
index bc0c44ab1bb..438e1fac3ea 100644
--- a/src/compiler/nir/nir_loop_analyze.c
+++ b/src/compiler/nir/nir_loop_analyze.c
@@ -619,51 +619,6 @@ find_trip_count(loop_info_state *state)
state->loop->info->limiting_terminator = limiting_terminator;
}
-/* Checks if we should force the loop to be unrolled regardless of size
- * due to array access heuristics.
- */
-static bool
-force_unroll_array_access_var(loop_info_state *state, nir_shader *ns,
- nir_deref_var *variable)
-{
- nir_deref *tail = &variable->deref;
-
- while (tail->child != NULL) {
- tail = tail->child;
-
- if (tail->deref_type == nir_deref_type_array) {
-
- nir_deref_array *deref_array = nir_deref_as_array(tail);
- if (deref_array->deref_array_type != nir_deref_array_type_indirect)
- continue;
-
- nir_loop_variable *array_index =
- get_loop_var(deref_array->indirect.ssa, state);
-
- if (array_index->type != basic_induction)
- continue;
-
- /* If an array is indexed by a loop induction variable, and the
- * array size is exactly the number of loop iterations, this is
- * probably a simple for-loop trying to access each element in
- * turn; the application may expect it to be unrolled.
- */
- if (glsl_get_length(variable->deref.type) ==
- state->loop->info->trip_count) {
- state->loop->info->force_unroll = true;
- return state->loop->info->force_unroll;
- }
-
- if (variable->var->data.mode & state->indirect_mask) {
- state->loop->info->force_unroll = true;
- return state->loop->info->force_unroll;
- }
- }
- }
-
- return false;
-}
-
static bool
force_unroll_array_access(loop_info_state *state, nir_shader *ns,
nir_deref_instr *deref)
@@ -708,17 +663,6 @@ force_unroll_heuristics(loop_info_state *state, nir_shader *ns,
/* Check for arrays variably-indexed by a loop induction variable.
* Unrolling the loop may convert that access into constant-indexing.
*/
- if (intrin->intrinsic == nir_intrinsic_load_var ||
- intrin->intrinsic == nir_intrinsic_store_var ||
- intrin->intrinsic == nir_intrinsic_copy_var) {
- unsigned num_vars =
- nir_intrinsic_infos[intrin->intrinsic].num_variables;
- for (unsigned i = 0; i < num_vars; i++) {
- if (force_unroll_array_access_var(state, ns, intrin->variables[i]))
- return true;
- }
- }
-
if (intrin->intrinsic == nir_intrinsic_load_deref ||
intrin->intrinsic == nir_intrinsic_store_deref ||
intrin->intrinsic == nir_intrinsic_copy_deref) {