summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/r300
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers/r300')
-rw-r--r--src/gallium/drivers/r300/compiler/radeon_optimize.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/gallium/drivers/r300/compiler/radeon_optimize.c b/src/gallium/drivers/r300/compiler/radeon_optimize.c
index b7a0e20797c..2d799a6547a 100644
--- a/src/gallium/drivers/r300/compiler/radeon_optimize.c
+++ b/src/gallium/drivers/r300/compiler/radeon_optimize.c
@@ -681,6 +681,20 @@ static void omod_filter_reader_cb(
}
}
+static void omod_filter_writer_cb(
+ void * userdata,
+ struct rc_instruction * inst,
+ rc_register_file file,
+ unsigned int index,
+ unsigned int mask)
+{
+ struct peephole_mul_cb_data * d = userdata;
+ if (file == d->Writer->File && index == d->Writer->Index &&
+ (mask & d->Writer->WriteMask)) {
+ d->Clobbered = 1;
+ }
+}
+
static int peephole_mul_omod(
struct radeon_compiler * c,
struct rc_instruction * inst_mul,
@@ -788,6 +802,8 @@ static int peephole_mul_omod(
inst = inst->Prev) {
rc_for_all_reads_mask(inst, omod_filter_reader_cb,
&cb_data);
+ rc_for_all_writes_mask(inst, omod_filter_writer_cb,
+ &cb_data);
if (cb_data.Clobbered) {
break;
}