OSDN Git Service

v3d: Fix copy-propagation of input unpacks.
authorEric Anholt <eric@anholt.net>
Mon, 4 Feb 2019 18:35:40 +0000 (10:35 -0800)
committerEric Anholt <eric@anholt.net>
Tue, 5 Feb 2019 23:46:04 +0000 (15:46 -0800)
commit940501a446ea954a4437c49d0683e5e7f9681bad
tree541efd77308688b71d075619ded667d564267ae7
parente5c6938590e5e495ce4f3f07dbdd53ca67297462
v3d: Fix copy-propagation of input unpacks.

I had a single function for "does this do float input unpacking" with two
major flaws: It was missing the most common thing to try to copy propagate
a f32 input nunpack to (the VFPACK to an FP16 render target) along with
several other ALU ops, and also would try to propagate an f32 unpack into
a VFMUL which only does f16 unpacks.

instructions in affected programs: 659232 -> 655895 (-0.51%)
uniforms in affected programs: 132613 -> 135336 (2.05%)

and a couple of programs increase their thread counts.

The uniforms hit appears to be a pattern in generated code of doing (-a >=
a) comparisons, which when a is abs(b) can result in the abs instruction
being copy propagated once but not fully DCEed.
src/broadcom/compiler/v3d_compiler.h
src/broadcom/compiler/vir.c
src/broadcom/compiler/vir_opt_copy_propagate.c
src/broadcom/qpu/qpu_instr.c
src/broadcom/qpu/qpu_instr.h