summaryrefslogtreecommitdiffstats
path: root/src/glsl/nir
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2014-12-12 16:25:38 -0800
committerJason Ekstrand <[email protected]>2015-01-15 07:20:21 -0800
commit295faf9462cba88250d8581f65611996eba5e389 (patch)
treeaafe263df770d4596119f8b62547a96430fead15 /src/glsl/nir
parentb6c81b3ff453d51898f86a819f80ea1128aea0fe (diff)
nir: Call nir_metadata_preserve more places
Reviewed-by: Connor Abbott <[email protected]>
Diffstat (limited to 'src/glsl/nir')
-rw-r--r--src/glsl/nir/nir_from_ssa.c3
-rw-r--r--src/glsl/nir/nir_lower_atomics.c5
-rw-r--r--src/glsl/nir/nir_lower_io.c3
-rw-r--r--src/glsl/nir/nir_lower_locals_to_regs.c3
-rw-r--r--src/glsl/nir/nir_lower_system_values.c2
-rw-r--r--src/glsl/nir/nir_opt_constant_folding.c4
-rw-r--r--src/glsl/nir/nir_opt_dce.c4
-rw-r--r--src/glsl/nir/nir_to_ssa.c5
8 files changed, 27 insertions, 2 deletions
diff --git a/src/glsl/nir/nir_from_ssa.c b/src/glsl/nir/nir_from_ssa.c
index f99ba9b7828..d3295804b5a 100644
--- a/src/glsl/nir/nir_from_ssa.c
+++ b/src/glsl/nir/nir_from_ssa.c
@@ -843,6 +843,9 @@ nir_convert_from_ssa_impl(nir_function_impl *impl)
nir_foreach_block(impl, resolve_parallel_copies_block, &state);
+ nir_metadata_preserve(impl, nir_metadata_block_index |
+ nir_metadata_dominance);
+
/* Clean up dead instructions and the hash tables */
_mesa_hash_table_destroy(state.ssa_table, NULL);
_mesa_hash_table_destroy(state.merge_node_table, NULL);
diff --git a/src/glsl/nir/nir_lower_atomics.c b/src/glsl/nir/nir_lower_atomics.c
index 23d5de0c0ac..b43e4fedf0d 100644
--- a/src/glsl/nir/nir_lower_atomics.c
+++ b/src/glsl/nir/nir_lower_atomics.c
@@ -137,7 +137,10 @@ void
nir_lower_atomics(nir_shader *shader)
{
nir_foreach_overload(shader, overload) {
- if (overload->impl)
+ if (overload->impl) {
nir_foreach_block(overload->impl, lower_block, overload->impl);
+ nir_metadata_preserve(overload->impl, nir_metadata_block_index |
+ nir_metadata_dominance);
+ }
}
}
diff --git a/src/glsl/nir/nir_lower_io.c b/src/glsl/nir/nir_lower_io.c
index 9fc11b3ca8c..91ad561fda5 100644
--- a/src/glsl/nir/nir_lower_io.c
+++ b/src/glsl/nir/nir_lower_io.c
@@ -310,6 +310,9 @@ nir_lower_io_impl(nir_function_impl *impl)
state.mem_ctx = ralloc_parent(impl);
nir_foreach_block(impl, nir_lower_io_block, &state);
+
+ nir_metadata_preserve(impl, nir_metadata_block_index |
+ nir_metadata_dominance);
}
void
diff --git a/src/glsl/nir/nir_lower_locals_to_regs.c b/src/glsl/nir/nir_lower_locals_to_regs.c
index e2a8fa74e10..f0238b09dab 100644
--- a/src/glsl/nir/nir_lower_locals_to_regs.c
+++ b/src/glsl/nir/nir_lower_locals_to_regs.c
@@ -292,6 +292,9 @@ nir_lower_locals_to_regs_impl(nir_function_impl *impl)
nir_foreach_block(impl, lower_locals_to_regs_block, &state);
+ nir_metadata_preserve(impl, nir_metadata_block_index |
+ nir_metadata_dominance);
+
_mesa_hash_table_destroy(state.regs_table, NULL);
}
diff --git a/src/glsl/nir/nir_lower_system_values.c b/src/glsl/nir/nir_lower_system_values.c
index e700df43bb4..7bb02a77bd9 100644
--- a/src/glsl/nir/nir_lower_system_values.c
+++ b/src/glsl/nir/nir_lower_system_values.c
@@ -91,6 +91,8 @@ static void
convert_impl(nir_function_impl *impl)
{
nir_foreach_block(impl, convert_block, NULL);
+ nir_metadata_preserve(impl, nir_metadata_block_index |
+ nir_metadata_dominance);
}
void
diff --git a/src/glsl/nir/nir_opt_constant_folding.c b/src/glsl/nir/nir_opt_constant_folding.c
index 6ffa694a34f..3160a3fffb3 100644
--- a/src/glsl/nir/nir_opt_constant_folding.c
+++ b/src/glsl/nir/nir_opt_constant_folding.c
@@ -330,6 +330,10 @@ nir_opt_constant_folding_impl(nir_function_impl *impl)
nir_foreach_block(impl, constant_fold_block, &state);
+ if (state.progress)
+ nir_metadata_preserve(impl, nir_metadata_block_index |
+ nir_metadata_dominance);
+
return state.progress;
}
diff --git a/src/glsl/nir/nir_opt_dce.c b/src/glsl/nir/nir_opt_dce.c
index 365a8cd75df..8a7490dc3e0 100644
--- a/src/glsl/nir/nir_opt_dce.c
+++ b/src/glsl/nir/nir_opt_dce.c
@@ -166,6 +166,10 @@ nir_opt_dce_impl(nir_function_impl *impl)
bool progress = false;
nir_foreach_block(impl, delete_block_cb, &progress);
+ if (progress)
+ nir_metadata_preserve(impl, nir_metadata_block_index |
+ nir_metadata_dominance);
+
return progress;
}
diff --git a/src/glsl/nir/nir_to_ssa.c b/src/glsl/nir/nir_to_ssa.c
index e73a6eef611..7fdae493887 100644
--- a/src/glsl/nir/nir_to_ssa.c
+++ b/src/glsl/nir/nir_to_ssa.c
@@ -630,7 +630,7 @@ destroy_rewrite_state(rewrite_state *state)
void
nir_convert_to_ssa_impl(nir_function_impl *impl)
{
- nir_calc_dominance_impl(impl);
+ nir_metadata_require(impl, nir_metadata_dominance);
insert_phi_nodes(impl);
@@ -641,6 +641,9 @@ nir_convert_to_ssa_impl(nir_function_impl *impl)
remove_unused_regs(impl, &state);
+ nir_metadata_preserve(impl, nir_metadata_block_index |
+ nir_metadata_dominance);
+
destroy_rewrite_state(&state);
}