diff options
author | Eduardo Lima Mitev <elima@igalia.com> | 2015-10-22 15:25:23 +0200 |
---|---|---|
committer | Eduardo Lima Mitev <elima@igalia.com> | 2015-11-10 21:13:35 +0100 |
commit | 94ff35204dba0ddbd7f5c4342206c8acba22d32f (patch) | |
tree | 24ffbd63b7184b28da364307da7837c2295f1eac | |
parent | 96b22fb080894ba1840af2372f28a46cc0f40c76 (diff) | |
download | external_mesa3d-94ff35204dba0ddbd7f5c4342206c8acba22d32f.zip external_mesa3d-94ff35204dba0ddbd7f5c4342206c8acba22d32f.tar.gz external_mesa3d-94ff35204dba0ddbd7f5c4342206c8acba22d32f.tar.bz2 |
nir/nir_opt_peephole_ffma: Move this lowering pass to the i965 driver
Because the next patch will add an optimization that is specific to i965,
we want to move this loweing pass to that driver altogether.
This is safe because i965 is the only consumer.
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
-rw-r--r-- | src/glsl/Makefile.sources | 1 | ||||
-rw-r--r-- | src/glsl/nir/nir.h | 1 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/Makefile.sources | 1 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_nir.c | 2 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_nir.h | 2 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_nir_opt_peephole_ffma.c (renamed from src/glsl/nir/nir_opt_peephole_ffma.c) | 12 |
6 files changed, 10 insertions, 9 deletions
diff --git a/src/glsl/Makefile.sources b/src/glsl/Makefile.sources index 78d295b..d4b02c1 100644 --- a/src/glsl/Makefile.sources +++ b/src/glsl/Makefile.sources @@ -67,7 +67,6 @@ NIR_FILES = \ nir/nir_opt_dead_cf.c \ nir/nir_opt_gcm.c \ nir/nir_opt_global_to_local.c \ - nir/nir_opt_peephole_ffma.c \ nir/nir_opt_peephole_select.c \ nir/nir_opt_remove_phis.c \ nir/nir_opt_undef.c \ diff --git a/src/glsl/nir/nir.h b/src/glsl/nir/nir.h index 13ebbca..4ed2cbd 100644 --- a/src/glsl/nir/nir.h +++ b/src/glsl/nir/nir.h @@ -2029,7 +2029,6 @@ bool nir_opt_dead_cf(nir_shader *shader); void nir_opt_gcm(nir_shader *shader); bool nir_opt_peephole_select(nir_shader *shader); -bool nir_opt_peephole_ffma(nir_shader *shader); bool nir_opt_remove_phis(nir_shader *shader); diff --git a/src/mesa/drivers/dri/i965/Makefile.sources b/src/mesa/drivers/dri/i965/Makefile.sources index 434583d..f5e84cb 100644 --- a/src/mesa/drivers/dri/i965/Makefile.sources +++ b/src/mesa/drivers/dri/i965/Makefile.sources @@ -46,6 +46,7 @@ i965_compiler_FILES = \ brw_nir.h \ brw_nir.c \ brw_nir_analyze_boolean_resolves.c \ + brw_nir_opt_peephole_ffma.c \ brw_nir_uniforms.cpp \ brw_packed_float.c \ brw_predicated_break.cpp \ diff --git a/src/mesa/drivers/dri/i965/brw_nir.c b/src/mesa/drivers/dri/i965/brw_nir.c index dece208..fe5cad4 100644 --- a/src/mesa/drivers/dri/i965/brw_nir.c +++ b/src/mesa/drivers/dri/i965/brw_nir.c @@ -293,7 +293,7 @@ brw_create_nir(struct brw_context *brw, if (brw->gen >= 6) { /* Try and fuse multiply-adds */ - nir_opt_peephole_ffma(nir); + brw_nir_opt_peephole_ffma(nir); nir_validate_shader(nir); } diff --git a/src/mesa/drivers/dri/i965/brw_nir.h b/src/mesa/drivers/dri/i965/brw_nir.h index b4a6dc0..e7c9368 100644 --- a/src/mesa/drivers/dri/i965/brw_nir.h +++ b/src/mesa/drivers/dri/i965/brw_nir.h @@ -94,6 +94,8 @@ void brw_nir_setup_glsl_uniforms(nir_shader *shader, void brw_nir_setup_arb_uniforms(nir_shader *shader, struct gl_program *prog, struct brw_stage_prog_data *stage_prog_data); +bool brw_nir_opt_peephole_ffma(nir_shader *shader); + #ifdef __cplusplus } #endif diff --git a/src/glsl/nir/nir_opt_peephole_ffma.c b/src/mesa/drivers/dri/i965/brw_nir_opt_peephole_ffma.c index 4f0f0da..a8448e7 100644 --- a/src/glsl/nir/nir_opt_peephole_ffma.c +++ b/src/mesa/drivers/dri/i965/brw_nir_opt_peephole_ffma.c @@ -25,7 +25,7 @@ * */ -#include "nir.h" +#include "brw_nir.h" /* * Implements a small peephole optimization that looks for a multiply that @@ -134,7 +134,7 @@ get_mul_for_src(nir_alu_src *src, int num_components, } static bool -nir_opt_peephole_ffma_block(nir_block *block, void *void_state) +brw_nir_opt_peephole_ffma_block(nir_block *block, void *void_state) { struct peephole_ffma_state *state = void_state; @@ -237,7 +237,7 @@ nir_opt_peephole_ffma_block(nir_block *block, void *void_state) } static bool -nir_opt_peephole_ffma_impl(nir_function_impl *impl) +brw_nir_opt_peephole_ffma_impl(nir_function_impl *impl) { struct peephole_ffma_state state; @@ -245,7 +245,7 @@ nir_opt_peephole_ffma_impl(nir_function_impl *impl) state.impl = impl; state.progress = false; - nir_foreach_block(impl, nir_opt_peephole_ffma_block, &state); + nir_foreach_block(impl, brw_nir_opt_peephole_ffma_block, &state); if (state.progress) nir_metadata_preserve(impl, nir_metadata_block_index | @@ -255,13 +255,13 @@ nir_opt_peephole_ffma_impl(nir_function_impl *impl) } bool -nir_opt_peephole_ffma(nir_shader *shader) +brw_nir_opt_peephole_ffma(nir_shader *shader) { bool progress = false; nir_foreach_overload(shader, overload) { if (overload->impl) - progress |= nir_opt_peephole_ffma_impl(overload->impl); + progress |= brw_nir_opt_peephole_ffma_impl(overload->impl); } return progress; |