[Mesa-dev] [PATCH 6/6] i965/fs: Allow constant propagation into IF with embedded compare.

Eric Anholt eric at anholt.net
Wed Dec 21 15:33:09 PST 2011


This saves a couple of instructions on most programs with control
flow.  More interestingly, 6 shaders from unigine sanctuary now fit
into 16-wide without register spilling.
---
 src/mesa/drivers/dri/i965/brw_fs.cpp |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp
index 8ca4a87..b6aa60e 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
@@ -1144,6 +1144,7 @@ fs_visitor::propagate_constants()
 	       break;
 
 	    case BRW_OPCODE_CMP:
+	    case BRW_OPCODE_IF:
 	       if (i == 1) {
 		  scan_inst->src[i] = inst->src[0];
 		  progress = true;
-- 
1.7.7.3



More information about the mesa-dev mailing list