Revert "r300: be less agresive with copy propagate in loops"
This reverts commit 2bdffe7eb2
.
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>
This commit is contained in:
@@ -688,7 +688,6 @@ static void get_readers_for_single_write(
|
|||||||
unsigned int branch_depth = 0;
|
unsigned int branch_depth = 0;
|
||||||
struct rc_instruction * endloop = NULL;
|
struct rc_instruction * endloop = NULL;
|
||||||
unsigned int abort_on_read_at_endloop = 0;
|
unsigned int abort_on_read_at_endloop = 0;
|
||||||
int readers_before_endloop = -1;
|
|
||||||
struct get_readers_callback_data * d = userdata;
|
struct get_readers_callback_data * d = userdata;
|
||||||
|
|
||||||
d->ReaderData->Writer = writer;
|
d->ReaderData->Writer = writer;
|
||||||
@@ -696,7 +695,6 @@ static void get_readers_for_single_write(
|
|||||||
d->ReaderData->AbortOnWrite = 0;
|
d->ReaderData->AbortOnWrite = 0;
|
||||||
d->ReaderData->LoopDepth = 0;
|
d->ReaderData->LoopDepth = 0;
|
||||||
d->ReaderData->InElse = 0;
|
d->ReaderData->InElse = 0;
|
||||||
d->ReaderData->ReadersAfterEndloop = false;
|
|
||||||
d->DstFile = dst_file;
|
d->DstFile = dst_file;
|
||||||
d->DstIndex = dst_index;
|
d->DstIndex = dst_index;
|
||||||
d->DstMask = dst_mask;
|
d->DstMask = dst_mask;
|
||||||
@@ -782,19 +780,11 @@ static void get_readers_for_single_write(
|
|||||||
get_readers_pair_read_callback, d);
|
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 */
|
/* This can happen when we jump from an ENDLOOP to BGNLOOP */
|
||||||
if (tmp == writer) {
|
if (tmp == writer) {
|
||||||
tmp = endloop;
|
tmp = endloop;
|
||||||
endloop = NULL;
|
endloop = NULL;
|
||||||
d->ReaderData->AbortOnRead = abort_on_read_at_endloop;
|
d->ReaderData->AbortOnRead = abort_on_read_at_endloop;
|
||||||
readers_before_endloop = d->ReaderData->ReaderCount;
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
rc_for_all_writes_mask(tmp, get_readers_write_callback, d);
|
rc_for_all_writes_mask(tmp, get_readers_write_callback, d);
|
||||||
|
@@ -31,8 +31,6 @@
|
|||||||
|
|
||||||
#include "radeon_program_constants.h"
|
#include "radeon_program_constants.h"
|
||||||
|
|
||||||
#include <stdbool.h>
|
|
||||||
|
|
||||||
struct radeon_compiler;
|
struct radeon_compiler;
|
||||||
struct rc_instruction;
|
struct rc_instruction;
|
||||||
struct rc_swizzle_caps;
|
struct rc_swizzle_caps;
|
||||||
@@ -93,7 +91,6 @@ struct rc_reader_data {
|
|||||||
unsigned int AbortOnWrite;
|
unsigned int AbortOnWrite;
|
||||||
unsigned int LoopDepth;
|
unsigned int LoopDepth;
|
||||||
unsigned int InElse;
|
unsigned int InElse;
|
||||||
bool ReadersAfterEndloop;
|
|
||||||
struct rc_instruction * Writer;
|
struct rc_instruction * Writer;
|
||||||
|
|
||||||
unsigned int ReaderCount;
|
unsigned int ReaderCount;
|
||||||
|
@@ -154,7 +154,7 @@ static void copy_propagate(struct radeon_compiler * c, struct rc_instruction * i
|
|||||||
copy_propagate_scan_read, NULL,
|
copy_propagate_scan_read, NULL,
|
||||||
is_src_clobbered_scan_write);
|
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;
|
return;
|
||||||
|
|
||||||
/* We can propagate SaturateMode if all the readers are MOV instructions
|
/* We can propagate SaturateMode if all the readers are MOV instructions
|
||||||
|
Reference in New Issue
Block a user