diff options
author | Rob Clark <[email protected]> | 2019-02-23 11:14:32 -0500 |
---|---|---|
committer | Rob Clark <[email protected]> | 2019-02-26 13:19:44 -0500 |
commit | cb884d8ab210b4793eb55852b4f07642c71a99a5 (patch) | |
tree | 44c89a11ff1b83dc3c6b6b1b3e3f323dcd6ddf0b /src/freedreno/ir3/ir3_legalize.c | |
parent | 04c2520d91920725d91a7be6e415d6ab56aeeaab (diff) |
freedreno/ir3: use nopN encoding when possible
Use the (nopN) encoding for slightly denser shaders.. this lets us fold
nop instructions into the previous alu instruction in certain cases.
Shouldn't change the # of cycles a shader takes to execute, but reduces
the size. (ex: glmark2 refract goes from 168 to 116 instructions)
Currently only enabled for a6xx, but I think we could enable this for
a5xx and possibly a4xx.
Signed-off-by: Rob Clark <[email protected]>
Diffstat (limited to 'src/freedreno/ir3/ir3_legalize.c')
-rw-r--r-- | src/freedreno/ir3/ir3_legalize.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/freedreno/ir3/ir3_legalize.c b/src/freedreno/ir3/ir3_legalize.c index 00f0c9c9b8d..b14a789efb2 100644 --- a/src/freedreno/ir3/ir3_legalize.c +++ b/src/freedreno/ir3/ir3_legalize.c @@ -200,6 +200,16 @@ legalize_block(struct ir3_legalize_ctx *ctx, struct ir3_block *block) last->flags |= n->flags; continue; } + + /* NOTE: I think the nopN encoding works for a5xx and + * probably a4xx, but not a3xx. So far only tested on + * a6xx. + */ + if ((ctx->compiler->gpu_id >= 600) && !n->flags && (last->nop < 3) && + ((opc_cat(last->opc) == 2) || (opc_cat(last->opc) == 3))) { + last->nop++; + continue; + } } list_addtail(&n->node, &block->instr_list); |