i965/fs: Consider predicated SEL instructions as whole variable writes.
authorKenneth Graunke <kenneth@whitecape.org>
Mon, 5 Aug 2013 23:24:43 +0000 (16:24 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Mon, 12 Aug 2013 20:12:59 +0000 (13:12 -0700)
The instruction

   (+f0.0) SEL dst, src0, src1

will write either src0 or src1 to dst, depending on the predicate.
Unlike most predicated instructions, it always writes to dst.

fs_inst::is_partial_write() is supposed to return true if the whole
register is guaranteed to be written.  The !inst->predicated check makes
sense for most instructions, which might not write the whole register,
but SEL is a special case.

This caused live interval analysis to ignore the destination of
predicated SEL instructions when computing "def" information.

Requires the previous commit to avoid regressions.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
src/mesa/drivers/dri/i965/brw_fs.cpp

index a9533104176ef5102f319eb921d9b165f8216e52..f404b0b2be225d3ac16b4c1d4d5b42b6c2e7a594 100644 (file)
@@ -689,7 +689,7 @@ fs_visitor::pop_force_sechalf()
 bool
 fs_inst::is_partial_write()
 {
-   return (this->predicate ||
+   return ((this->predicate && this->opcode != BRW_OPCODE_SEL) ||
            this->force_uncompressed ||
            this->force_sechalf);
 }