i965/fs: Short-circuit a loop in live variable analysis.
authorKenneth Graunke <kenneth@whitecape.org>
Tue, 6 Aug 2013 07:47:00 +0000 (00:47 -0700)
committerEric Anholt <eric@anholt.net>
Thu, 10 Oct 2013 22:54:14 +0000 (15:54 -0700)
This has no functional effect, but should make subsequent changes a
little simpler.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
src/mesa/drivers/dri/i965/brw_fs_live_variables.cpp

index f5daab2d2ce3ba7ae5040cebf0a0caa6bf1e5a54..18ba30aad6b054013bca4de6d669c6cbdfb0cd60 100644 (file)
@@ -64,12 +64,13 @@ fs_live_variables::setup_def_use()
 
         /* Set use[] for this instruction */
         for (unsigned int i = 0; i < 3; i++) {
-           if (inst->src[i].file == GRF) {
-              int reg = inst->src[i].reg;
+           if (inst->src[i].file != GRF)
+               continue;
 
-              if (!BITSET_TEST(bd[b].def, reg))
-                 BITSET_SET(bd[b].use, reg);
-           }
+            int reg = inst->src[i].reg;
+
+            if (!BITSET_TEST(bd[b].def, reg))
+               BITSET_SET(bd[b].use, reg);
         }
 
         /* Check for unconditional writes to whole registers. These