diff options
author | Jason Ekstrand <[email protected]> | 2019-01-05 09:13:44 -0600 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2019-05-04 03:52:05 +0000 |
commit | 91899495a14568e9f23fa64d4bf4f5ef3f017fb9 (patch) | |
tree | 1a60c9941a25099c41948abac1d198454cdd4bba /src/compiler/nir/nir.h | |
parent | 694d1a08d3e5883d97d5352895f8431f76596cb8 (diff) |
nir: Add a SSA type gathering pass
This new pass (which isn't even compile-tested) attempts to determine
the ALU type of all the SSA values in a function impl. It takes a
greedy approach and assigns intness or floatness to everything it thinks
can possibly contain an int or a float. Some values will be labled as
both int and float and some will be labled as neither and it is up to
the caller to decide what to do with this information. However, for a
"nice" shader where the original source contained no bit-casts and no
implicit bit-casts were introduced by optimizations, there shouldn't be
any overlap in the two sets save for the odd CSEd zero constant.
Reviewed-by: Vasily Khoruzhick <[email protected]>
Diffstat (limited to 'src/compiler/nir/nir.h')
-rw-r--r-- | src/compiler/nir/nir.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h index 3083adbfcd9..ed21032e5e1 100644 --- a/src/compiler/nir/nir.h +++ b/src/compiler/nir/nir.h @@ -3044,6 +3044,10 @@ bool nir_lower_vars_to_scratch(nir_shader *shader, void nir_shader_gather_info(nir_shader *shader, nir_function_impl *entrypoint); +void nir_gather_ssa_types(nir_function_impl *impl, + BITSET_WORD *float_types, + BITSET_WORD *int_types); + void nir_assign_var_locations(struct exec_list *var_list, unsigned *size, int (*type_size)(const struct glsl_type *, bool)); |