[Mesa-dev] [PATCH 10/21] nir/cf: add block_ends_in_jump()

Kenneth Graunke kenneth at whitecape.org
Wed Jul 29 15:20:43 PDT 2015


On Tuesday, July 21, 2015 07:54:24 PM Connor Abbott wrote:
> Signed-off-by: Connor Abbott <connor.w.abbott at intel.com>
> ---
>  src/glsl/nir/nir_control_flow.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/src/glsl/nir/nir_control_flow.c b/src/glsl/nir/nir_control_flow.c
> index b416a58..b99bf89 100644
> --- a/src/glsl/nir/nir_control_flow.c
> +++ b/src/glsl/nir/nir_control_flow.c
> @@ -293,6 +293,14 @@ move_successors(nir_block *source, nir_block *dest)
>     link_blocks(dest, succ1, succ2);
>  }
>  
> +static bool
> +block_ends_in_jump(nir_block *block)
> +{
> +   return !exec_list_is_empty(&block->instr_list) &&
> +          nir_block_last_instr(block)->type == nir_instr_type_jump;
> +}
> +
> +
>  /* Given a basic block with no successors that has been inserted into the
>   * control flow tree, gives it the successors it would normally have assuming
>   * it doesn't end in a jump instruction. Also inserts phi sources with undefs
> 

There are a couple conditions that could be turned into
!block_ends_in_jump(...), even after your series.  Might be worth doing.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20150729/df6df407/attachment.sig>


More information about the mesa-dev mailing list