freedreno: Remove silly return from ir3_optimize_nir().

We only ever return the shader we were passed in (but internally
modified).

Reviewed-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
This commit is contained in:
Eric Anholt
2019-06-05 11:43:13 -07:00
parent 56842d33d5
commit 01d0bad9ef
5 changed files with 11 additions and 13 deletions
+3 -7
View File
@@ -71,13 +71,9 @@ ir3_context_init(struct ir3_compiler *compiler,
* creating duplicate variants..
*/
if (ir3_key_lowers_nir(&so->key)) {
nir_shader *s = nir_shader_clone(ctx, so->shader->nir);
ctx->s = ir3_optimize_nir(so->shader, s, &so->key);
} else {
/* fast-path for shader key that lowers nothing in NIR: */
ctx->s = nir_shader_clone(ctx, so->shader->nir);
}
ctx->s = nir_shader_clone(ctx, so->shader->nir);
if (ir3_key_lowers_nir(&so->key))
ir3_optimize_nir(so->shader, ctx->s, &so->key);
/* this needs to be the last pass run, so do this here instead of
* in ir3_optimize_nir():
+1 -3
View File
@@ -174,7 +174,7 @@ ir3_optimize_loop(nir_shader *s)
} while (progress);
}
struct nir_shader *
void
ir3_optimize_nir(struct ir3_shader *shader, nir_shader *s,
const struct ir3_shader_key *key)
{
@@ -281,8 +281,6 @@ ir3_optimize_nir(struct ir3_shader *shader, nir_shader *s,
if (!key) {
ir3_setup_const_state(shader, s);
}
return s;
}
static void
+1 -1
View File
@@ -43,7 +43,7 @@ bool ir3_nir_move_varying_inputs(nir_shader *shader);
const nir_shader_compiler_options * ir3_get_compiler_options(struct ir3_compiler *compiler);
bool ir3_key_lowers_nir(const struct ir3_shader_key *key);
struct nir_shader * ir3_optimize_nir(struct ir3_shader *shader, nir_shader *s,
void ir3_optimize_nir(struct ir3_shader *shader, nir_shader *s,
const struct ir3_shader_key *key);
bool ir3_nir_analyze_ubo_ranges(nir_shader *nir, struct ir3_shader *shader);
+3 -1
View File
@@ -292,7 +292,9 @@ ir3_shader_from_nir(struct ir3_compiler *compiler, nir_shader *nir)
NIR_PASS_V(nir, nir_lower_io_arrays_to_elements_no_indirects, false);
/* do first pass optimization, ignoring the key: */
shader->nir = ir3_optimize_nir(shader, nir, NULL);
ir3_optimize_nir(shader, nir, NULL);
shader->nir = nir;
if (ir3_shader_debug & IR3_DBG_DISASM) {
printf("dump nir%d: type=%d", shader->id, shader->type);
nir_print_shader(shader->nir, stdout);
@@ -490,7 +490,9 @@ int main(int argc, char **argv)
}
s.compiler = compiler;
s.nir = ir3_optimize_nir(&s, nir, NULL);
s.nir = nir;
ir3_optimize_nir(&s, nir, NULL);
v.key = key;
v.shader = &s;