i965: Add a second successor to BRW_OPCODE_WHILE
authorNeil Roberts <neil@linux.intel.com>
Mon, 5 Oct 2015 11:50:56 +0000 (13:50 +0200)
committerNeil Roberts <neil@linux.intel.com>
Fri, 9 Oct 2015 13:13:22 +0000 (15:13 +0200)
It is possible to directly predicate the WHILE instruction. In this
case there will be a second successor block because the execution can
resume from the instruction after the loop. This will be used in a
subsequent patch.

Reviewed-by: Matt Turner <mattst88@gmail.com>
src/mesa/drivers/dri/i965/brw_cfg.cpp

index 91d53eff5a709cfc971a84ffbafe4d6c7284d320..531fa16b3872cc3d1f614ecab969e41aa0d41b2c 100644 (file)
@@ -305,6 +305,10 @@ cfg_t::cfg_t(exec_list *instructions)
 
          assert(cur_do != NULL && cur_while != NULL);
         cur->add_successor(mem_ctx, cur_do);
+
+         if (inst->predicate)
+            cur->add_successor(mem_ctx, cur_while);
+
         set_next_block(&cur, cur_while, ip);
 
         /* Pop the stack so we're in the previous loop */