ir3, tu: Run optimization loop twice

This call to ir3_optimize_nir() mirrors what st/mesa does for us in
Gallium, and will be necessary for cross-stage linking and the multiview
lowering.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6515>
This commit is contained in:
Connor Abbott 2020-07-06 18:26:14 +02:00 committed by Marge Bot
parent 41a5a21858
commit 6982e8510b
3 changed files with 4 additions and 1 deletions

View File

@ -153,7 +153,7 @@ ir3_get_compiler_options(struct ir3_compiler *compiler)
#define OPT_V(nir, pass, ...) NIR_PASS_V(nir, pass, ##__VA_ARGS__)
static void
void
ir3_optimize_loop(nir_shader *s)
{
bool progress;

View File

@ -52,6 +52,7 @@ void ir3_nir_lower_tess_eval(nir_shader *shader, unsigned topology);
void ir3_nir_lower_gs(nir_shader *shader);
const nir_shader_compiler_options * ir3_get_compiler_options(struct ir3_compiler *compiler);
void ir3_optimize_loop(nir_shader *s);
void ir3_finalize_nir(struct ir3_compiler *compiler, nir_shader *s);
void ir3_nir_post_finalize(struct ir3_compiler *compiler, nir_shader *s);
void ir3_nir_lower_variant(struct ir3_shader_variant *so, nir_shader *s);

View File

@ -175,6 +175,8 @@ tu_spirv_to_nir(struct tu_device *dev,
NIR_PASS_V(nir, nir_lower_frexp);
ir3_optimize_loop(nir);
return nir;
}