Merge remote-tracking branch 'mesa-public/master' into vulkan
[mesa.git] / src / mesa / drivers / dri / i965 / brw_fs_register_coalesce.cpp
index 20a548000996cf4193266a39fc20d40fe2de4cbd..72e873857ced950272a885b15db2914b50ba3e2c 100644 (file)
@@ -241,20 +241,19 @@ fs_visitor::register_coalesce()
       }
 
       foreach_block_and_inst(block, fs_inst, scan_inst, cfg) {
-         for (int i = 0; i < src_size; i++) {
-            if (scan_inst->dst.file == GRF &&
-                scan_inst->dst.reg == reg_from &&
-                scan_inst->dst.reg_offset == i) {
-               scan_inst->dst.reg = reg_to;
-               scan_inst->dst.reg_offset = reg_to_offset[i];
-            }
-            for (int j = 0; j < scan_inst->sources; j++) {
-               if (scan_inst->src[j].file == GRF &&
-                   scan_inst->src[j].reg == reg_from &&
-                   scan_inst->src[j].reg_offset == i) {
-                  scan_inst->src[j].reg = reg_to;
-                  scan_inst->src[j].reg_offset = reg_to_offset[i];
-               }
+         if (scan_inst->dst.file == GRF &&
+             scan_inst->dst.reg == reg_from) {
+            scan_inst->dst.reg = reg_to;
+            scan_inst->dst.reg_offset =
+               reg_to_offset[scan_inst->dst.reg_offset];
+         }
+
+         for (int j = 0; j < scan_inst->sources; j++) {
+            if (scan_inst->src[j].file == GRF &&
+                scan_inst->src[j].reg == reg_from) {
+               scan_inst->src[j].reg = reg_to;
+               scan_inst->src[j].reg_offset =
+                  reg_to_offset[scan_inst->src[j].reg_offset];
             }
          }
       }