[Mesa-dev] [PATCH 11/20] i965/fs: Make count_to_loop_end() use basic blocks.

Matt Turner mattst88 at gmail.com
Mon Sep 8 12:23:26 PDT 2014


On Tue, Sep 2, 2014 at 9:34 PM, Matt Turner <mattst88 at gmail.com> wrote:
> When the instructions aren't in a flat list, this wouldn't have worked.
> Also, this should be faster.
> ---
>  src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp | 28 +++++++++++------------
>  1 file changed, 13 insertions(+), 15 deletions(-)
>
> diff --git a/src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp b/src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp
> index 88f394d..7e391ea 100644
> --- a/src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp
> +++ b/src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp
> @@ -190,27 +190,25 @@ brw_fs_alloc_reg_sets(struct intel_screen *screen)
>     brw_alloc_reg_set(screen, 2);
>  }
>
> -int
> -count_to_loop_end(fs_inst *do_inst)
> +static int
> +count_to_loop_end(bblock_t *block)
>  {

The predicated WHILE patch I sent lets us merge blocks such that a
block can start with a DO and end with a WHILE, so I'm going to add

+   if (block->end->opcode == BRW_OPCODE_WHILE)
+      return block->end_ip;

to the top of this function to handle that.


More information about the mesa-dev mailing list