[Mesa-dev] [PATCH 04/30] i965/fs: Restrict inequality that can only hold equal in saturate propagation.

Francisco Jerez currojerez at riseup.net
Mon Mar 14 03:47:08 UTC 2016


Should have no functional change.  The IP value of an instruction that
reads src_var cannot possibly be after the end of the live interval of
the variable it's reading from, by the definition of live interval.
Might save future readers a momentary WTF while trying to understand
this code.
---
 src/mesa/drivers/dri/i965/brw_fs_saturate_propagation.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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 dc2b0c8..f59fdbd 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_saturate_propagation.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_saturate_propagation.cpp
@@ -73,7 +73,7 @@ opt_saturate_propagation_local(fs_visitor *v, bblock_t *block)
             if (scan_inst->saturate) {
                inst->saturate = false;
                progress = true;
-            } else if (src_end_ip <= ip || inst->dst.equals(inst->src[0])) {
+            } else if (src_end_ip == ip || inst->dst.equals(inst->src[0])) {
                if (scan_inst->can_do_saturate()) {
                   if (scan_inst->dst.type != inst->dst.type) {
                      scan_inst->dst.type = inst->dst.type;
-- 
2.7.0



More information about the mesa-dev mailing list