Mesa (master): r300/compiler: rc_reader_data: Add ExitOnAbort flag

Tom Stellard tstellar at kemper.freedesktop.org
Sat Apr 30 11:26:11 PDT 2011


Module: Mesa
Branch: master
Commit: 4f4d1d06da5e151df39c60fe75ab686ffdd73659
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=4f4d1d06da5e151df39c60fe75ab686ffdd73659

Author: Tom Stellard <tstellar at gmail.com>
Date:   Sun Jan 30 15:29:29 2011 -0800

r300/compiler: rc_reader_data: Add ExitOnAbort flag

---

 .../drivers/dri/r300/compiler/radeon_dataflow.c    |    6 +++---
 .../drivers/dri/r300/compiler/radeon_dataflow.h    |    3 +++
 .../drivers/dri/r300/compiler/radeon_optimize.c    |    2 ++
 .../dri/r300/compiler/radeon_pair_schedule.c       |    1 +
 .../drivers/dri/r300/compiler/radeon_rename_regs.c |    1 +
 5 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_dataflow.c b/src/mesa/drivers/dri/r300/compiler/radeon_dataflow.c
index b483709..3c0ab10 100644
--- a/src/mesa/drivers/dri/r300/compiler/radeon_dataflow.c
+++ b/src/mesa/drivers/dri/r300/compiler/radeon_dataflow.c
@@ -592,7 +592,7 @@ static void get_readers_pair_read_callback(
 	if (d->ReadPairCB)
 		d->ReadPairCB(d->ReaderData, inst, arg, src);
 
-	if (d->ReaderData->Abort)
+	if (d->ReaderData->ExitOnAbort && d->ReaderData->Abort)
 		return;
 
 	add_reader_pair(&d->C->Pool, d->ReaderData, inst, shared_mask, arg, src);
@@ -620,7 +620,7 @@ static void get_readers_normal_read_callback(
 	if (d->ReadNormalCB)
 		d->ReadNormalCB(d->ReaderData, inst, src);
 
-	if (d->ReaderData->Abort)
+	if (d->ReaderData->ExitOnAbort && d->ReaderData->Abort)
 		return;
 
 	add_reader_normal(&d->C->Pool, d->ReaderData, inst, shared_mask, src);
@@ -767,7 +767,7 @@ static void get_readers_for_single_write(
 		}
 		rc_for_all_writes_mask(tmp, get_readers_write_callback, d);
 
-		if (d->ReaderData->Abort)
+		if (d->ReaderData->ExitOnAbort && d->ReaderData->Abort)
 			return;
 
 		if (branch_depth == 0 && !d->AliveWriteMask)
diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_dataflow.h b/src/mesa/drivers/dri/r300/compiler/radeon_dataflow.h
index 77d5d74..1e30cc6 100644
--- a/src/mesa/drivers/dri/r300/compiler/radeon_dataflow.h
+++ b/src/mesa/drivers/dri/r300/compiler/radeon_dataflow.h
@@ -94,6 +94,9 @@ struct rc_reader_data {
 	unsigned int ReadersReserved;
 	struct rc_reader * Readers;
 
+	/* If this flag is enabled, rc_get_readers will exit as soon possbile
+	 * after the Abort flag is set.*/
+	unsigned int ExitOnAbort;
 	void * CbData;
 };
 
diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_optimize.c b/src/mesa/drivers/dri/r300/compiler/radeon_optimize.c
index 104f7bf..447193e 100644
--- a/src/mesa/drivers/dri/r300/compiler/radeon_optimize.c
+++ b/src/mesa/drivers/dri/r300/compiler/radeon_optimize.c
@@ -144,6 +144,7 @@ static void copy_propagate(struct radeon_compiler * c, struct rc_instruction * i
 		return;
 
 	/* Get a list of all the readers of this MOV instruction. */
+	reader_data.ExitOnAbort = 1;
 	rc_get_readers(c, inst_mov, &reader_data,
 		       copy_propagate_scan_read, NULL,
 		       is_src_clobbered_scan_write);
@@ -453,6 +454,7 @@ static int presub_helper(
 	rc_presubtract_op cb_op = presub_opcode;
 
 	reader_data.CbData = &cb_op;
+	reader_data.ExitOnAbort = 1;
 	rc_get_readers(c, inst_add, &reader_data, presub_scan_read, NULL,
 						is_src_clobbered_scan_write);
 
diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_pair_schedule.c b/src/mesa/drivers/dri/r300/compiler/radeon_pair_schedule.c
index dad8ef5..3743b02 100644
--- a/src/mesa/drivers/dri/r300/compiler/radeon_pair_schedule.c
+++ b/src/mesa/drivers/dri/r300/compiler/radeon_pair_schedule.c
@@ -952,6 +952,7 @@ static void schedule_block(struct r300_fragment_program_compiler * c,
 			instruction_ready(&s, s.Current);
 
 		/* Get global readers for possible RGB->Alpha conversion. */
+		s.Current->GlobalReaders.ExitOnAbort = 1;
 		rc_get_readers(s.C, inst, &s.Current->GlobalReaders,
 				is_rgb_to_alpha_possible_normal,
 				is_rgb_to_alpha_possible, NULL);
diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_rename_regs.c b/src/mesa/drivers/dri/r300/compiler/radeon_rename_regs.c
index d4d96b4..cafa057 100644
--- a/src/mesa/drivers/dri/r300/compiler/radeon_rename_regs.c
+++ b/src/mesa/drivers/dri/r300/compiler/radeon_rename_regs.c
@@ -71,6 +71,7 @@ void rc_rename_regs(struct radeon_compiler *c, void *user)
 		if (inst->U.I.DstReg.File != RC_FILE_TEMPORARY)
 			continue;
 
+		reader_data.ExitOnAbort = 1;
 		rc_get_readers(c, inst, &reader_data, NULL, NULL, NULL);
 
 		if (reader_data.Abort || reader_data.ReaderCount == 0)



More information about the mesa-commit mailing list