mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-06 08:50:09 +01:00
i965/vec4: don't copy propagate vector opcodes that operate in align1 mode
Basically, ALIGN1 mode will ignore swizzles on the input vectors so we don't want the copy propagation pass to mess with them. Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Matt Turner <mattst88@gmail.com>
This commit is contained in:
parent
553700cf55
commit
7ec57e91d6
1 changed files with 24 additions and 0 deletions
|
|
@ -282,6 +282,22 @@ try_constant_propagate(const struct gen_device_info *devinfo,
|
|||
return false;
|
||||
}
|
||||
|
||||
static bool
|
||||
is_align1_opcode(unsigned opcode)
|
||||
{
|
||||
switch (opcode) {
|
||||
case VEC4_OPCODE_DOUBLE_TO_FLOAT:
|
||||
case VEC4_OPCODE_FLOAT_TO_DOUBLE:
|
||||
case VEC4_OPCODE_PICK_LOW_32BIT:
|
||||
case VEC4_OPCODE_PICK_HIGH_32BIT:
|
||||
case VEC4_OPCODE_SET_LOW_32BIT:
|
||||
case VEC4_OPCODE_SET_HIGH_32BIT:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
static bool
|
||||
try_copy_propagate(const struct gen_device_info *devinfo,
|
||||
vec4_instruction *inst, int arg,
|
||||
|
|
@ -326,6 +342,14 @@ try_copy_propagate(const struct gen_device_info *devinfo,
|
|||
|
||||
unsigned composed_swizzle = brw_compose_swizzle(inst->src[arg].swizzle,
|
||||
value.swizzle);
|
||||
|
||||
/* Instructions that operate on vectors in ALIGN1 mode will ignore swizzles
|
||||
* so copy-propagation won't be safe if the composed swizzle is anything
|
||||
* other than the identity.
|
||||
*/
|
||||
if (is_align1_opcode(inst->opcode) && composed_swizzle != BRW_SWIZZLE_XYZW)
|
||||
return false;
|
||||
|
||||
if (inst->is_3src(devinfo) &&
|
||||
(value.file == UNIFORM ||
|
||||
(value.file == ATTR && attributes_per_reg != 1)) &&
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue