From 701e9af15f9cedd8c1dbad417d195ee2a46e07bf Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Tue, 6 Aug 2013 00:47:00 -0700 Subject: [PATCH] i965/fs: Short-circuit a loop in live variable analysis. This has no functional effect, but should make subsequent changes a little simpler. Signed-off-by: Kenneth Graunke Reviewed-by: Eric Anholt --- src/mesa/drivers/dri/i965/brw_fs_live_variables.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/mesa/drivers/dri/i965/brw_fs_live_variables.cpp b/src/mesa/drivers/dri/i965/brw_fs_live_variables.cpp index f5daab2d2ce..18ba30aad6b 100644 --- a/src/mesa/drivers/dri/i965/brw_fs_live_variables.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs_live_variables.cpp @@ -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 -- 2.30.2