From 6662aae49f0499ca9875eca3a774bfb8e66e6404 Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Sat, 9 Feb 2013 19:12:54 -0500 Subject: [PATCH 6/6] r300g/compiler: Fix bug in OMOD folding The OMOD value was only being folded to one instruction in cases where the MUL instruction was reading a value written by more than one instruction. https://bugs.freedesktop.org/show_bug.cgi?id=60503 NOTE: This is a candidate for the stable branches. --- .../drivers/r300/compiler/radeon_optimize.c | 2 +- 3 files changed, 77 insertions(+), 1 deletions(-) create mode 100644 src/gallium/drivers/r300/compiler/tests/radeon_compiler_optimize_tests.c diff --git a/src/gallium/drivers/r300/compiler/radeon_optimize.c b/src/gallium/drivers/r300/compiler/radeon_optimize.c index 7be9d9e..b626e33 100644 --- a/src/gallium/drivers/r300/compiler/radeon_optimize.c +++ b/src/gallium/drivers/r300/compiler/radeon_optimize.c @@ -833,7 +833,7 @@ static int peephole_mul_omod( /* Rewrite the instructions */ for (var = writer_list->Item; var; var = var->Friend) { - struct rc_variable * writer = writer_list->Item; + struct rc_variable * writer = var; unsigned conversion_swizzle = rc_make_conversion_swizzle( writer->Inst->U.I.DstReg.WriteMask, inst_mul->U.I.DstReg.WriteMask); -- 1.7.3.4