i965/fs: Extend SEL peephole to handle only matching MOVs.
authorMatt Turner <mattst88@gmail.com>
Wed, 30 Oct 2013 04:39:52 +0000 (21:39 -0700)
committerMatt Turner <mattst88@gmail.com>
Thu, 5 Dec 2013 04:05:44 +0000 (20:05 -0800)
commit4532cac06a9da527549efb685c6f37ffed24ddbf
tree4ef87e514480aa34fe6f22f8b1beb8ebe10a06b0
parent13de9f03f177d3ae0921fded1a102b66130f8b40
i965/fs: Extend SEL peephole to handle only matching MOVs.

Before this patch, the following code would not be optimized even though
the first two instructions were common to the then and else blocks:

   (+f0) IF
   MOV dst0 ...
   MOV dst1 ...
   MOV dst2 ...
   ELSE
   MOV dst0 ...
   MOV dst1 ...
   MOV dst3 ...
   ENDIF

This commit extends the peephole to handle this case.

No shader-db changes.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
src/mesa/drivers/dri/i965/brw_fs_sel_peephole.cpp