diff options
author | Jason Ekstrand <[email protected]> | 2015-08-28 17:17:39 -0700 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2015-09-09 12:28:51 -0700 |
commit | f5e08ab6b1351c41000fd2f1a16c1273d2f74d40 (patch) | |
tree | e2552024443a01567321f117db4e91cb23209919 /src/glsl/nir/nir.h | |
parent | 3e9df0e3af7a8a84147ae48f588e9c435bf65b98 (diff) |
nir/cursor: Add a constructor for the end of a block but before the jump
Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/glsl/nir/nir.h')
-rw-r--r-- | src/glsl/nir/nir.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/glsl/nir/nir.h b/src/glsl/nir/nir.h index 3c375f30c53..2bcd18aabe5 100644 --- a/src/glsl/nir/nir.h +++ b/src/glsl/nir/nir.h @@ -1608,6 +1608,17 @@ nir_after_instr(nir_instr *instr) } static inline nir_cursor +nir_after_block_before_jump(nir_block *block) +{ + nir_instr *last_instr = nir_block_last_instr(block); + if (last_instr && last_instr->type == nir_instr_type_jump) { + return nir_before_instr(last_instr); + } else { + return nir_after_block(block); + } +} + +static inline nir_cursor nir_before_cf_node(nir_cf_node *node) { if (node->type == nir_cf_node_block) |