freedreno/ir3: cleanup double cmps.s from frontend
authorRob Clark <robclark@freedesktop.org>
Thu, 7 Apr 2016 16:53:07 +0000 (12:53 -0400)
committerRob Clark <robclark@freedesktop.org>
Wed, 13 Apr 2016 18:14:41 +0000 (14:14 -0400)
commitb35ad6e7016a877def4b3d2d22b3a2265a68e2eb
tree19f1437daeabb2ab6b098318f2dcd8521dccc6e9
parent9bac27dbf92d32cd8685868d21d0317a5a56f333
freedreno/ir3: cleanup double cmps.s from frontend

Since we cannot mov into a predicate register, the frontend uses a
'cmps.s p0.x, cond, 0' as a stand-in for mov to p0.x.  It does this
since it has no way to know that the source cond instruction (ie.
for a kill, br, etc) will only be used to write the predicate reg.
Detect this, and re-write the instruction writing p0.x to skip the
original cmps.[sfu].  (It is done like this, rather than re-writing
the dest of the first cmps.[sfu] in case the first cmps.[sfu]
actually has other users.)

Signed-off-by: Rob Clark <robclark@freedesktop.org>
src/gallium/drivers/freedreno/ir3/ir3_cp.c