mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 02:20:11 +01:00
freedreno/ir3: avoid extra mov's for "arrays"
Signed-off-by: Rob Clark <robdclark@gmail.com>
This commit is contained in:
parent
2bc3fb6992
commit
ac459a6f7f
1 changed files with 23 additions and 3 deletions
|
|
@ -348,7 +348,7 @@ create_array_load(struct ir3_context *ctx, struct ir3_array *arr, int n,
|
|||
}
|
||||
|
||||
/* relative (indirect) if address!=NULL */
|
||||
static struct ir3_instruction *
|
||||
static void
|
||||
create_array_store(struct ir3_context *ctx, struct ir3_array *arr, int n,
|
||||
struct ir3_instruction *src, struct ir3_instruction *address)
|
||||
{
|
||||
|
|
@ -356,6 +356,28 @@ create_array_store(struct ir3_context *ctx, struct ir3_array *arr, int n,
|
|||
struct ir3_instruction *mov;
|
||||
struct ir3_register *dst;
|
||||
|
||||
/* if not relative store, don't create an extra mov, since that
|
||||
* ends up being difficult for cp to remove.
|
||||
*/
|
||||
if (!address) {
|
||||
dst = src->regs[0];
|
||||
|
||||
src->barrier_class |= IR3_BARRIER_ARRAY_W;
|
||||
src->barrier_conflict |= IR3_BARRIER_ARRAY_R | IR3_BARRIER_ARRAY_W;
|
||||
|
||||
dst->flags |= IR3_REG_ARRAY;
|
||||
dst->instr = arr->last_write;
|
||||
dst->size = arr->length;
|
||||
dst->array.id = arr->id;
|
||||
dst->array.offset = n;
|
||||
|
||||
arr->last_write = src;
|
||||
|
||||
array_insert(block, block->keeps, src);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
mov = ir3_instr_create(block, OPC_MOV);
|
||||
mov->cat1.src_type = TYPE_U32;
|
||||
mov->cat1.dst_type = TYPE_U32;
|
||||
|
|
@ -379,8 +401,6 @@ create_array_store(struct ir3_context *ctx, struct ir3_array *arr, int n,
|
|||
* pass won't know this.. so keep all array stores:
|
||||
*/
|
||||
array_insert(block, block->keeps, mov);
|
||||
|
||||
return mov;
|
||||
}
|
||||
|
||||
/* allocate a n element value array (to be populated by caller) and
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue