pan/mdg: Return the instruction from mir_insert_instruction_*_scheduled
We can't return a pointer to the bundle itself because it might move about in memory. CC: mesa-stable Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16382>
This commit is contained in:
parent
ca2be07484
commit
7b9c976c2d
|
@ -516,8 +516,8 @@ void mir_print_shader(compiler_context *ctx);
|
|||
bool mir_nontrivial_mod(midgard_instruction *ins, unsigned i, bool check_swizzle);
|
||||
bool mir_nontrivial_outmod(midgard_instruction *ins);
|
||||
|
||||
void mir_insert_instruction_before_scheduled(compiler_context *ctx, midgard_block *block, midgard_instruction *tag, midgard_instruction ins);
|
||||
void mir_insert_instruction_after_scheduled(compiler_context *ctx, midgard_block *block, midgard_instruction *tag, midgard_instruction ins);
|
||||
midgard_instruction *mir_insert_instruction_before_scheduled(compiler_context *ctx, midgard_block *block, midgard_instruction *tag, midgard_instruction ins);
|
||||
midgard_instruction *mir_insert_instruction_after_scheduled(compiler_context *ctx, midgard_block *block, midgard_instruction *tag, midgard_instruction ins);
|
||||
void mir_flip(midgard_instruction *ins);
|
||||
void mir_compute_temp_count(compiler_context *ctx);
|
||||
|
||||
|
|
|
@ -378,7 +378,7 @@ mir_bundle_idx_for_ins(midgard_instruction *tag, midgard_block *block)
|
|||
unreachable("Instruction not scheduled in block");
|
||||
}
|
||||
|
||||
void
|
||||
midgard_instruction *
|
||||
mir_insert_instruction_before_scheduled(
|
||||
compiler_context *ctx,
|
||||
midgard_block *block,
|
||||
|
@ -398,9 +398,11 @@ mir_insert_instruction_before_scheduled(
|
|||
|
||||
list_addtail(&new.instructions[0]->link, &before_bundle->instructions[0]->link);
|
||||
block->quadword_count += midgard_tag_props[new.tag].size;
|
||||
|
||||
return new.instructions[0];
|
||||
}
|
||||
|
||||
void
|
||||
midgard_instruction *
|
||||
mir_insert_instruction_after_scheduled(
|
||||
compiler_context *ctx,
|
||||
midgard_block *block,
|
||||
|
@ -423,6 +425,8 @@ mir_insert_instruction_after_scheduled(
|
|||
memcpy(bundles + after + 1, &new, sizeof(new));
|
||||
list_add(&new.instructions[0]->link, &after_bundle->instructions[after_bundle->instruction_count - 1]->link);
|
||||
block->quadword_count += midgard_tag_props[new.tag].size;
|
||||
|
||||
return new.instructions[0];
|
||||
}
|
||||
|
||||
/* Flip the first-two arguments of a (binary) op. Currently ALU
|
||||
|
|
Loading…
Reference in New Issue