if (arg == 1) {
inst->src[arg] = value;
return true;
} else if (arg == 0 && inst->src[1].file != IMM) {
/* Fit this constant in by commuting the operands. Exception: we
if (arg == 1) {
inst->src[arg] = value;
return true;
} else if (arg == 0 && inst->src[1].file != IMM) {
/* Fit this constant in by commuting the operands. Exception: we
-vec4_visitor::try_copy_propagation(struct intel_context *intel,
- vec4_instruction *inst, int arg,
+vec4_visitor::try_copy_propagation(vec4_instruction *inst, int arg,
- if (has_source_modifiers && !can_do_source_mods(inst))
+ if ((has_source_modifiers || value.file == UNIFORM ||
+ value.swizzle != BRW_SWIZZLE_XYZW) && !can_do_source_mods(inst))
+ return false;
+
+ if (has_source_modifiers && value.type != inst->src[arg].type)
/* We can't copy-propagate a UD negation into a condmod
* instruction, because the condmod ends up looking at the 33-bit
* signed accumulator value instead of the 32-bit value we wanted
/* We can't copy-propagate a UD negation into a condmod
* instruction, because the condmod ends up looking at the 33-bit
* signed accumulator value instead of the 32-bit value we wanted