summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPavel Ondračka <pavel.ondracka@gmail.com>2022-09-21 21:20:32 +0200
committerPavel Ondračka <pavel.ondracka@gmail.com>2022-10-03 08:49:24 +0200
commitff933485b7e328c5041050d5e41a2dd28a032a92 (patch)
tree100cd2bd430775be81818b0bbb8a053b5ab3d8dd
parent1f0a0a46d9775c97ef6411bdb098d5836a2985d9 (diff)
Revert "r300: be less agresive with copy propagate in loops"
This reverts commit 2bdffe7eb212ddc10f2ed9ef51095886a55109b4. This solution was mostly a workaround to fix the copy propagation. A (hopefully) proper fix to the reader detection is in the next commit. Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com> Reviewed-by: Filip Gawin <filip@gawin.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18900>
-rw-r--r--src/gallium/drivers/r300/compiler/radeon_dataflow.c10
-rw-r--r--src/gallium/drivers/r300/compiler/radeon_dataflow.h3
-rw-r--r--src/gallium/drivers/r300/compiler/radeon_optimize.c2
3 files changed, 1 insertions, 14 deletions
diff --git a/src/gallium/drivers/r300/compiler/radeon_dataflow.c b/src/gallium/drivers/r300/compiler/radeon_dataflow.c
index c0acb3ee681..302576b9fed 100644
--- a/src/gallium/drivers/r300/compiler/radeon_dataflow.c
+++ b/src/gallium/drivers/r300/compiler/radeon_dataflow.c
@@ -688,7 +688,6 @@ static void get_readers_for_single_write(
unsigned int branch_depth = 0;
struct rc_instruction * endloop = NULL;
unsigned int abort_on_read_at_endloop = 0;
- int readers_before_endloop = -1;
struct get_readers_callback_data * d = userdata;
d->ReaderData->Writer = writer;
@@ -696,7 +695,6 @@ static void get_readers_for_single_write(
d->ReaderData->AbortOnWrite = 0;
d->ReaderData->LoopDepth = 0;
d->ReaderData->InElse = 0;
- d->ReaderData->ReadersAfterEndloop = false;
d->DstFile = dst_file;
d->DstIndex = dst_index;
d->DstMask = dst_mask;
@@ -782,19 +780,11 @@ static void get_readers_for_single_write(
get_readers_pair_read_callback, d);
}
- /* Writer was in loop and we have some readers after it.
- * Set a flag so we can be extra careful in copy propagate.
- */
- if (readers_before_endloop != -1 &&
- d->ReaderData->ReaderCount > readers_before_endloop)
- d->ReaderData->ReadersAfterEndloop = true;
-
/* This can happen when we jump from an ENDLOOP to BGNLOOP */
if (tmp == writer) {
tmp = endloop;
endloop = NULL;
d->ReaderData->AbortOnRead = abort_on_read_at_endloop;
- readers_before_endloop = d->ReaderData->ReaderCount;
continue;
}
rc_for_all_writes_mask(tmp, get_readers_write_callback, d);
diff --git a/src/gallium/drivers/r300/compiler/radeon_dataflow.h b/src/gallium/drivers/r300/compiler/radeon_dataflow.h
index ef8e2bfe851..bb8d48206e2 100644
--- a/src/gallium/drivers/r300/compiler/radeon_dataflow.h
+++ b/src/gallium/drivers/r300/compiler/radeon_dataflow.h
@@ -31,8 +31,6 @@
#include "radeon_program_constants.h"
-#include <stdbool.h>
-
struct radeon_compiler;
struct rc_instruction;
struct rc_swizzle_caps;
@@ -93,7 +91,6 @@ struct rc_reader_data {
unsigned int AbortOnWrite;
unsigned int LoopDepth;
unsigned int InElse;
- bool ReadersAfterEndloop;
struct rc_instruction * Writer;
unsigned int ReaderCount;
diff --git a/src/gallium/drivers/r300/compiler/radeon_optimize.c b/src/gallium/drivers/r300/compiler/radeon_optimize.c
index 5b5d92f9f90..08ac6d2f494 100644
--- a/src/gallium/drivers/r300/compiler/radeon_optimize.c
+++ b/src/gallium/drivers/r300/compiler/radeon_optimize.c
@@ -154,7 +154,7 @@ static void copy_propagate(struct radeon_compiler * c, struct rc_instruction * i
copy_propagate_scan_read, NULL,
is_src_clobbered_scan_write);
- if (reader_data.Abort || reader_data.ReaderCount == 0 || reader_data.ReadersAfterEndloop)
+ if (reader_data.Abort || reader_data.ReaderCount == 0)
return;
/* We can propagate SaturateMode if all the readers are MOV instructions