diff options
author | Christoph Bumiller <[email protected]> | 2011-04-08 15:51:48 +0200 |
---|---|---|
committer | Christoph Bumiller <[email protected]> | 2011-04-10 14:06:51 +0200 |
commit | ee2a8ea7d9004c052916db79eac644ef51a9ccaa (patch) | |
tree | d85a6adda073ec429f56e043b4a727cc0e0ae30f /src/gallium/drivers/nv50/nv50_tgsi_to_nc.c | |
parent | d27ff8c5cd22ac0279948d3df4b3384eef866cde (diff) |
nv50,nvc0: don't insert instructions after the block terminator
Diffstat (limited to 'src/gallium/drivers/nv50/nv50_tgsi_to_nc.c')
-rw-r--r-- | src/gallium/drivers/nv50/nv50_tgsi_to_nc.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/gallium/drivers/nv50/nv50_tgsi_to_nc.c b/src/gallium/drivers/nv50/nv50_tgsi_to_nc.c index 1449cb04c69..f548836a9c4 100644 --- a/src/gallium/drivers/nv50/nv50_tgsi_to_nc.c +++ b/src/gallium/drivers/nv50/nv50_tgsi_to_nc.c @@ -273,6 +273,12 @@ fetch_by_bb(struct bld_value_stack *stack, fetch_by_bb(stack, vals, n, b->in[i]); } +static INLINE boolean +nvbb_is_terminated(struct nv_basic_block *bb) +{ + return bb->exit && bb->exit->is_terminator; +} + static INLINE struct nv_value * bld_load_imm_u32(struct bld_context *bld, uint32_t u); @@ -1727,8 +1733,7 @@ bld_instruction(struct bld_context *bld, { struct nv_basic_block *b = new_basic_block(bld->pc); - if (bld->pc->current_block->exit && - !bld->pc->current_block->exit->is_terminator) + if (!nvbb_is_terminated(bld->pc->current_block)) bld_flow(bld, NV_OP_BRA, NV_CC_TR, NULL, b, FALSE); --bld->cond_lvl; @@ -1800,7 +1805,8 @@ bld_instruction(struct bld_context *bld, { struct nv_basic_block *bb = bld->loop_bb[bld->loop_lvl - 1]; - bld_flow(bld, NV_OP_BRA, NV_CC_TR, NULL, bb, FALSE); + if (!nvbb_is_terminated(bld->pc->current_block)) + bld_flow(bld, NV_OP_BRA, NV_CC_TR, NULL, bb, FALSE); nvbb_attach_block(bld->pc->current_block, bb, CFG_EDGE_BACK); |