diff options
author | Matt Turner <mattst88@gmail.com> | 2014-07-16 21:51:19 -0700 |
---|---|---|
committer | Matt Turner <mattst88@gmail.com> | 2014-08-22 10:23:34 -0700 |
commit | 1db74a423f7bada1e78a840eae6231ee01f909f2 (patch) | |
tree | 481cc061af88c6ae0525a7b17613f608da9e82d7 /src/mesa/drivers/dri/i965/brw_fs_sel_peephole.cpp | |
parent | 81755bc67bd16bfeb1c4db817125dde85ba9b264 (diff) | |
download | external_mesa3d-1db74a423f7bada1e78a840eae6231ee01f909f2.zip external_mesa3d-1db74a423f7bada1e78a840eae6231ee01f909f2.tar.gz external_mesa3d-1db74a423f7bada1e78a840eae6231ee01f909f2.tar.bz2 |
i965/fs: Preserve CFG in the SEL peephole.
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_fs_sel_peephole.cpp')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_fs_sel_peephole.cpp | 15 |
1 files changed, 9 insertions, 6 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 d64cd98..f609138 100644 --- a/src/mesa/drivers/dri/i965/brw_fs_sel_peephole.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs_sel_peephole.cpp @@ -212,23 +212,26 @@ fs_visitor::opt_peephole_sel() if (brw->gen == 6 && if_inst->conditional_mod) { fs_inst *cmp_inst = CMP(reg_null_d, if_inst->src[0], if_inst->src[1], if_inst->conditional_mod); - if_inst->insert_before(cmp_inst); + if_inst->insert_before(block, cmp_inst); } + bblock_t *then_block = (bblock_t *)block->link.next; + bblock_t *else_block = (bblock_t *)block->else_block->link.next; + for (int i = 0; i < movs; i++) { if (mov_imm_inst[i]) - if_inst->insert_before(mov_imm_inst[i]); - if_inst->insert_before(sel_inst[i]); + if_inst->insert_before(block, mov_imm_inst[i]); + if_inst->insert_before(block, sel_inst[i]); - then_mov[i]->remove(); - else_mov[i]->remove(); + then_mov[i]->remove(then_block); + else_mov[i]->remove(else_block); } progress = true; } if (progress) - invalidate_live_intervals(); + invalidate_live_intervals(false); return progress; } |