summaryrefslogtreecommitdiffstats
path: root/src/freedreno
diff options
context:
space:
mode:
authorRob Clark <[email protected]>2019-10-15 15:46:42 -0700
committerRob Clark <[email protected]>2019-10-24 13:08:56 -0700
commit9e211b57b85903d4444880b753f22206da86221c (patch)
tree13470fbf3408c6d02781b2f08deac835a9310088 /src/freedreno
parent49ab94694d73e719e348c0112d7e2bd74e486738 (diff)
freedreno/ir3: propagate dest flags for collect/fanin
We did this properly already for split/fanout. But collect was missed. Extract out a helper to share. This way we avoid copy propagating a mov from high or half reg into an instruction which cannot consume a high/half reg. Signed-off-by: Rob Clark <[email protected]> Reviewed-by: Kristian H. Kristensen <[email protected]>
Diffstat (limited to 'src/freedreno')
-rw-r--r--src/freedreno/ir3/ir3_context.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/freedreno/ir3/ir3_context.c b/src/freedreno/ir3/ir3_context.c
index 2543991f8d9..bdcf816bd12 100644
--- a/src/freedreno/ir3/ir3_context.c
+++ b/src/freedreno/ir3/ir3_context.c
@@ -239,6 +239,12 @@ ir3_put_dst(struct ir3_context *ctx, nir_dest *dst)
ctx->last_dst_n = 0;
}
+static unsigned
+dest_flags(struct ir3_instruction *instr)
+{
+ return instr->regs[0]->flags & (IR3_REG_HALF | IR3_REG_HIGH);
+}
+
struct ir3_instruction *
ir3_create_collect(struct ir3_context *ctx, struct ir3_instruction *const *arr,
unsigned arrsz)
@@ -249,7 +255,7 @@ ir3_create_collect(struct ir3_context *ctx, struct ir3_instruction *const *arr,
if (arrsz == 0)
return NULL;
- unsigned flags = arr[0]->regs[0]->flags & IR3_REG_HALF;
+ unsigned flags = dest_flags(arr[0]);
collect = ir3_instr_create2(block, OPC_META_FI, 1 + arrsz);
ir3_reg_create(collect, 0, flags); /* dst */
@@ -285,7 +291,7 @@ ir3_create_collect(struct ir3_context *ctx, struct ir3_instruction *const *arr,
elem = ir3_MOV(block, elem, type);
}
- compile_assert(ctx, (elem->regs[0]->flags & IR3_REG_HALF) == flags);
+ compile_assert(ctx, dest_flags(elem) == flags);
ir3_reg_create(collect, 0, IR3_REG_SSA | flags)->instr = elem;
}
@@ -308,7 +314,7 @@ ir3_split_dest(struct ir3_block *block, struct ir3_instruction **dst,
return;
}
- unsigned flags = src->regs[0]->flags & (IR3_REG_HALF | IR3_REG_HIGH);
+ unsigned flags = dest_flags(src);
for (int i = 0, j = 0; i < n; i++) {
struct ir3_instruction *split = ir3_instr_create(block, OPC_META_FO);