intel/compiler: use correct swizzle for replacement
authorLionel Landwerlin <lionel.g.landwerlin@intel.com>
Wed, 27 Feb 2019 15:53:21 +0000 (15:53 +0000)
committerLionel Landwerlin <lionel.g.landwerlin@intel.com>
Wed, 27 Feb 2019 20:06:42 +0000 (20:06 +0000)
commit6e184147ddce11e90c269a47af7d7395f5ed9c12
treee9b34fd9f529bfe6d54644ed15c39189449535ea
parent61e31886339b167bc85c48521664e456f0cfcf8e
intel/compiler: use correct swizzle for replacement

The optimization in 4cd1a0be76883c introduced a replacement of :

cmp(8).z.f0.0 vgrf11.y:D, vgrf10.xxxx:D, vgrf2.xyyy:D
...
cmp(8).nz.f0.0 null.x:D, vgrf11.yyyy:D, 0D

By :

cmp(8).z.f0.0 vgrf15.x:D, vgrf10.xxxx:D, vgrf2.yyyy:D
...
mov(8) vgrf11.y:D, vgrf15.yyyy:D

The first cmp instruction is storing in x while the second mov is
sourcing from y. We need to take into account where the replacement on
the scan_inst destination is going to store thing so that the
replacement mov can source things from the correct location.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 4cd1a0be76883c ("i965/vec4: Propagate conditional modifiers from more compares to other compares")
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=109759
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/intel/compiler/brw_vec4_cmod_propagation.cpp