diff options
author | Connor Abbott <[email protected]> | 2015-07-21 19:54:24 -0700 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2015-08-24 13:31:42 -0700 |
commit | f596e4021c4c1b2ce95ff32606e2f217955504bd (patch) | |
tree | ecb0f624b0376e77b714b9d5a9d3f3837a9463e2 /src/glsl | |
parent | 788d45cb478d6285fe6811c87b4f1db1daded6d9 (diff) |
nir/cf: add block_ends_in_jump()
Signed-off-by: Connor Abbott <[email protected]>
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/glsl')
-rw-r--r-- | src/glsl/nir/nir_control_flow.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/glsl/nir/nir_control_flow.c b/src/glsl/nir/nir_control_flow.c index b416a5813d3..b99bf895e69 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 |