[Mesa-dev] [PATCH 2/5] i965/fs: Walk instructions in reverse in saturate propagation.

Matt Turner mattst88 at gmail.com
Mon Sep 8 12:21:41 PDT 2014


When we find a mov.sat, we search backwards. We might as well search
everything else backwards as well and potentially look at fewer
instructions.

This change enables the next patch.
---
 src/mesa/drivers/dri/i965/brw_fs_saturate_propagation.cpp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_fs_saturate_propagation.cpp b/src/mesa/drivers/dri/i965/brw_fs_saturate_propagation.cpp
index 4c4b6bf..6f8f8d0 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_saturate_propagation.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_saturate_propagation.cpp
@@ -32,10 +32,10 @@ static bool
 opt_saturate_propagation_local(fs_visitor *v, bblock_t *block)
 {
    bool progress = false;
-   int ip = block->start_ip - 1;
+   int ip = block->end_ip + 1;
 
-   foreach_inst_in_block(fs_inst, inst, block) {
-      ip++;
+   foreach_inst_in_block_reverse(fs_inst, inst, block) {
+      ip--;
 
       if (inst->opcode != BRW_OPCODE_MOV ||
           inst->dst.file != GRF ||
-- 
1.8.5.5



More information about the mesa-dev mailing list