diff options
author | Matt Turner <[email protected]> | 2013-10-29 21:39:52 -0700 |
---|---|---|
committer | Matt Turner <[email protected]> | 2013-12-04 20:05:44 -0800 |
commit | 4532cac06a9da527549efb685c6f37ffed24ddbf (patch) | |
tree | 4ef87e514480aa34fe6f22f8b1beb8ebe10a06b0 /src | |
parent | 13de9f03f177d3ae0921fded1a102b66130f8b40 (diff) |
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 <[email protected]>
Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_fs_sel_peephole.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_fs_sel_peephole.cpp b/src/mesa/drivers/dri/i965/brw_fs_sel_peephole.cpp index 52be1b772e4..f2749945813 100644 --- a/src/mesa/drivers/dri/i965/brw_fs_sel_peephole.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs_sel_peephole.cpp @@ -147,7 +147,6 @@ fs_visitor::opt_peephole_sel() fs_inst *else_mov[MAX_MOVS] = { NULL }; fs_inst *then_mov[MAX_MOVS] = { NULL }; - bool malformed_mov_found = false; int movs = count_movs_from_if(then_mov, else_mov, if_inst, else_inst); @@ -166,7 +165,7 @@ fs_visitor::opt_peephole_sel() if (!then_mov[i]->dst.equals(else_mov[i]->dst) || then_mov[i]->is_partial_write() || else_mov[i]->is_partial_write()) { - malformed_mov_found = true; + movs = i; break; } @@ -193,7 +192,7 @@ fs_visitor::opt_peephole_sel() } } - if (malformed_mov_found) + if (movs == 0) continue; /* Emit a CMP if our IF used the embedded comparison */ |