ir3: Collapse is_ssa checks

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24432>
This commit is contained in:
Alyssa Rosenzweig
2023-08-01 12:26:02 -04:00
committed by Marge Bot
parent 2734f1b586
commit c3077d3ad4
2 changed files with 3 additions and 11 deletions
+3 -8
View File
@@ -380,13 +380,8 @@ emit_alu(struct ir3_context *ctx, nir_alu_instr *alu)
unsigned dst_sz, wrmask;
type_t dst_type = type_uint_size(nir_dest_bit_size(alu->dest.dest));
if (alu->dest.dest.is_ssa) {
dst_sz = alu->dest.dest.ssa.num_components;
wrmask = (1 << dst_sz) - 1;
} else {
dst_sz = alu->dest.dest.reg.reg->num_components;
wrmask = alu->dest.write_mask;
}
dst_sz = alu->dest.dest.ssa.num_components;
wrmask = (1 << dst_sz) - 1;
dst = ir3_get_dst(ctx, &alu->dest.dest, dst_sz);
@@ -513,7 +508,7 @@ emit_alu(struct ir3_context *ctx, nir_alu_instr *alu)
* src instruction and create a mov. This is easier for cp
* to eliminate.
*/
if (alu->src[0].src.is_ssa && is_sat_compatible(src[0]->opc) &&
if (is_sat_compatible(src[0]->opc) &&
(list_length(&alu->src[0].src.ssa->uses) == 1)) {
src[0]->flags |= IR3_INSTR_SAT;
dst[0] = ir3_MOV(b, src[0], dst_type);
@@ -236,9 +236,6 @@ handle_partial_const(nir_builder *b, nir_ssa_def **srcp, int *offp)
if (alu->op != nir_op_iadd)
return;
if (!(alu->src[0].src.is_ssa && alu->src[1].src.is_ssa))
return;
if (nir_src_is_const(alu->src[0].src)) {
*offp += nir_src_as_uint(alu->src[0].src);
*srcp = alu->src[1].src.ssa;