i965/vec4: Don't lose the force_writemask_all flag during CSE.

And set it in the MOV instructions that copy the temporary to the
original destination if the generator instruction had it set.

Reviewed-by: Matt Turner <mattst88@gmail.com>
This commit is contained in:
Francisco Jerez 2015-03-19 15:08:16 +02:00
parent 1db9c0cd0c
commit ce030a6399
1 changed files with 3 additions and 0 deletions

View File

@ -114,6 +114,7 @@ instructions_match(vec4_instruction *a, vec4_instruction *b)
a->conditional_mod == b->conditional_mod &&
a->dst.type == b->dst.type &&
a->dst.writemask == b->dst.writemask &&
a->force_writemask_all == b->force_writemask_all &&
a->regs_written == b->regs_written &&
operands_match(a, b);
}
@ -168,6 +169,8 @@ vec4_visitor::opt_cse_local(bblock_t *block)
for (unsigned i = 0; i < entry->generator->regs_written; ++i) {
vec4_instruction *copy = MOV(offset(entry->generator->dst, i),
offset(entry->tmp, i));
copy->force_writemask_all =
entry->generator->force_writemask_all;
entry->generator->insert_after(block, copy);
}