aboutsummaryrefslogtreecommitdiffstats
path: root/src/intel/compiler
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2020-05-21 20:41:28 -0500
committerMarge Bot <[email protected]>2020-06-11 05:08:12 +0000
commit92cfbb7d0ce3012684f07ace5b09c0a607258b62 (patch)
tree5a7271aef5a7b62c0a7756e2dba457dede489802 /src/intel/compiler
parent2b676b2ce87520042ffb1fae8a9c0d97ba0e3cbc (diff)
intel/nir: Call nir_metadata_preserve on !progress
Reviewed-by: Kenneth Graunke <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5171>
Diffstat (limited to 'src/intel/compiler')
-rw-r--r--src/intel/compiler/brw_nir_clamp_image_1d_2d_array_sizes.c2
-rw-r--r--src/intel/compiler/brw_nir_lower_conversions.c2
-rw-r--r--src/intel/compiler/brw_nir_lower_image_load_store.c15
-rw-r--r--src/intel/compiler/brw_nir_lower_mem_access_bit_sizes.c2
-rw-r--r--src/intel/compiler/brw_nir_opt_peephole_ffma.c5
5 files changed, 20 insertions, 6 deletions
diff --git a/src/intel/compiler/brw_nir_clamp_image_1d_2d_array_sizes.c b/src/intel/compiler/brw_nir_clamp_image_1d_2d_array_sizes.c
index d77955a2d54..bc5e5864b62 100644
--- a/src/intel/compiler/brw_nir_clamp_image_1d_2d_array_sizes.c
+++ b/src/intel/compiler/brw_nir_clamp_image_1d_2d_array_sizes.c
@@ -132,6 +132,8 @@ brw_nir_clamp_image_1d_2d_array_sizes(nir_shader *shader)
nir_metadata_preserve(func->impl, nir_metadata_block_index |
nir_metadata_dominance);
progress = function_progress;
+ } else {
+ nir_metadata_preserve(func->impl, nir_metadata_all);
}
}
diff --git a/src/intel/compiler/brw_nir_lower_conversions.c b/src/intel/compiler/brw_nir_lower_conversions.c
index 9aff30b568b..0febb1f913e 100644
--- a/src/intel/compiler/brw_nir_lower_conversions.c
+++ b/src/intel/compiler/brw_nir_lower_conversions.c
@@ -150,6 +150,8 @@ lower_impl(nir_function_impl *impl)
if (progress) {
nir_metadata_preserve(impl, nir_metadata_block_index |
nir_metadata_dominance);
+ } else {
+ nir_metadata_preserve(impl, nir_metadata_all);
}
return progress;
diff --git a/src/intel/compiler/brw_nir_lower_image_load_store.c b/src/intel/compiler/brw_nir_lower_image_load_store.c
index 88b756b0775..1825c2f0221 100644
--- a/src/intel/compiler/brw_nir_lower_image_load_store.c
+++ b/src/intel/compiler/brw_nir_lower_image_load_store.c
@@ -689,6 +689,7 @@ brw_nir_lower_image_load_store(nir_shader *shader,
if (function->impl == NULL)
continue;
+ bool impl_progress = false;
nir_foreach_block_safe(block, function->impl) {
nir_builder b;
nir_builder_init(&b, function->impl);
@@ -701,12 +702,12 @@ brw_nir_lower_image_load_store(nir_shader *shader,
switch (intrin->intrinsic) {
case nir_intrinsic_image_deref_load:
if (lower_image_load_instr(&b, devinfo, intrin))
- progress = true;
+ impl_progress = true;
break;
case nir_intrinsic_image_deref_store:
if (lower_image_store_instr(&b, devinfo, intrin))
- progress = true;
+ impl_progress = true;
break;
case nir_intrinsic_image_deref_atomic_add:
@@ -722,12 +723,12 @@ brw_nir_lower_image_load_store(nir_shader *shader,
if (uses_atomic_load_store)
*uses_atomic_load_store = true;
if (lower_image_atomic_instr(&b, devinfo, intrin))
- progress = true;
+ impl_progress = true;
break;
case nir_intrinsic_image_deref_size:
if (lower_image_size_instr(&b, devinfo, intrin))
- progress = true;
+ impl_progress = true;
break;
default:
@@ -737,8 +738,12 @@ brw_nir_lower_image_load_store(nir_shader *shader,
}
}
- if (progress)
+ if (impl_progress) {
+ progress = true;
nir_metadata_preserve(function->impl, nir_metadata_none);
+ } else {
+ nir_metadata_preserve(function->impl, nir_metadata_all);
+ }
}
return progress;
diff --git a/src/intel/compiler/brw_nir_lower_mem_access_bit_sizes.c b/src/intel/compiler/brw_nir_lower_mem_access_bit_sizes.c
index 19abc16a9c5..f67a414e873 100644
--- a/src/intel/compiler/brw_nir_lower_mem_access_bit_sizes.c
+++ b/src/intel/compiler/brw_nir_lower_mem_access_bit_sizes.c
@@ -275,6 +275,8 @@ lower_mem_access_bit_sizes_impl(nir_function_impl *impl,
if (progress) {
nir_metadata_preserve(impl, nir_metadata_block_index |
nir_metadata_dominance);
+ } else {
+ nir_metadata_preserve(impl, nir_metadata_all);
}
return progress;
diff --git a/src/intel/compiler/brw_nir_opt_peephole_ffma.c b/src/intel/compiler/brw_nir_opt_peephole_ffma.c
index 45a5f56c8aa..813ede4c1cb 100644
--- a/src/intel/compiler/brw_nir_opt_peephole_ffma.c
+++ b/src/intel/compiler/brw_nir_opt_peephole_ffma.c
@@ -277,9 +277,12 @@ brw_nir_opt_peephole_ffma_impl(nir_function_impl *impl)
progress |= brw_nir_opt_peephole_ffma_block(&builder, block);
}
- if (progress)
+ if (progress) {
nir_metadata_preserve(impl, nir_metadata_block_index |
nir_metadata_dominance);
+ } else {
+ nir_metadata_preserve(impl, nir_metadata_all);
+ }
return progress;
}