diff options
Diffstat (limited to 'src/compiler/nir/nir.h')
-rw-r--r-- | src/compiler/nir/nir.h | 41 |
1 files changed, 40 insertions, 1 deletions
diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h index 2c7237b4af2..c7da1e779db 100644 --- a/src/compiler/nir/nir.h +++ b/src/compiler/nir/nir.h @@ -1506,9 +1506,41 @@ typedef struct nir_if { } nir_if; typedef struct { + nir_if *nif; + + nir_instr *conditional_instr; + + nir_block *break_block; + nir_block *continue_from_block; + + bool continue_from_then; + + struct list_head loop_terminator_link; +} nir_loop_terminator; + +typedef struct { + /* Number of instructions in the loop */ + unsigned num_instructions; + + /* How many times the loop is run (if known) */ + unsigned trip_count; + bool is_trip_count_known; + + /* Unroll the loop regardless of its size */ + bool force_unroll; + + nir_loop_terminator *limiting_terminator; + + /* A list of loop_terminators terminating this loop. */ + struct list_head loop_terminator_list; +} nir_loop_info; + +typedef struct { nir_cf_node cf_node; struct exec_list body; /** < list of nir_cf_node */ + + nir_loop_info *info; } nir_loop; /** @@ -1521,6 +1553,7 @@ typedef enum { nir_metadata_dominance = 0x2, nir_metadata_live_ssa_defs = 0x4, nir_metadata_not_properly_reset = 0x8, + nir_metadata_loop_analysis = 0x10, } nir_metadata; typedef struct { @@ -1749,6 +1782,8 @@ typedef struct nir_shader_compiler_options { * information must be inferred from the list of input nir_variables. */ bool use_interpolated_input_intrinsics; + + unsigned max_unroll_iterations; } nir_shader_compiler_options; typedef struct nir_shader { @@ -1859,7 +1894,7 @@ nir_loop *nir_loop_create(nir_shader *shader); nir_function_impl *nir_cf_node_get_function(nir_cf_node *node); /** requests that the given pieces of metadata be generated */ -void nir_metadata_require(nir_function_impl *impl, nir_metadata required); +void nir_metadata_require(nir_function_impl *impl, nir_metadata required, ...); /** dirties all but the preserved metadata */ void nir_metadata_preserve(nir_function_impl *impl, nir_metadata preserved); @@ -2479,6 +2514,10 @@ void nir_lower_double_pack(nir_shader *shader); bool nir_normalize_cubemap_coords(nir_shader *shader); void nir_live_ssa_defs_impl(nir_function_impl *impl); + +void nir_loop_analyze_impl(nir_function_impl *impl, + nir_variable_mode indirect_mask); + bool nir_ssa_defs_interfere(nir_ssa_def *a, nir_ssa_def *b); void nir_convert_to_ssa_impl(nir_function_impl *impl); |