diff options
author | Alyssa Rosenzweig <[email protected]> | 2020-05-27 18:29:01 -0400 |
---|---|---|
committer | Marge Bot <[email protected]> | 2020-05-29 20:34:55 +0000 |
commit | d8c6a7187856edeb55ebd63c9274e9a780f22b35 (patch) | |
tree | 0ff309d1a7d92520a089e90ea4ecabc08021c174 /src/panfrost/bifrost | |
parent | e42a5dfd4f2b22c73f4627128ac6d3dbcb10aca1 (diff) |
pan/bi: Only rewrite COMBINE dest if not SSA
If it's already a register, there's no point in rewriting and it will
disturb the existing register, i.e. for
if (..) {
r0 = vecN ..
} else {
r0 = vecN ..
}
Signed-off-by: Alyssa Rosenzweig <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5260>
Diffstat (limited to 'src/panfrost/bifrost')
-rw-r--r-- | src/panfrost/bifrost/bi_lower_combine.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/panfrost/bifrost/bi_lower_combine.c b/src/panfrost/bifrost/bi_lower_combine.c index ae9ceb9742f..c2d9c51ffef 100644 --- a/src/panfrost/bifrost/bi_lower_combine.c +++ b/src/panfrost/bifrost/bi_lower_combine.c @@ -197,7 +197,8 @@ bi_lower_combine(bi_context *ctx, bi_block *block) bi_foreach_instr_in_block_safe(block, ins) { if (ins->type != BI_COMBINE) continue; - unsigned R = bi_make_temp_reg(ctx); + bool needs_rewrite = !(ins->dest & PAN_IS_REG); + unsigned R = needs_rewrite ? bi_make_temp_reg(ctx) : ins->dest; unsigned sz = nir_alu_type_get_type_size(ins->dest_type); bi_foreach_src(ins, s) { @@ -226,8 +227,9 @@ bi_lower_combine(bi_context *ctx, bi_block *block) } } + if (needs_rewrite) + bi_rewrite_uses(ctx, ins->dest, 0, R, 0); - bi_rewrite_uses(ctx, ins->dest, 0, R, 0); bi_remove_instruction(ins); } } |