mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 00:38:48 +02:00
pco: Move DITR and DITRP fencing from translation to legalization
Signed-off-by: Caius Moldovan <caius.moldovan@imgtec.com> Reviewed-by: Simon Perretta <simon.perretta@imgtec.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40724>
This commit is contained in:
parent
cc78a5dd4b
commit
092106d742
4 changed files with 42 additions and 13 deletions
|
|
@ -1781,6 +1781,7 @@ bool pco_const_imms(pco_shader *shader);
|
|||
bool pco_bool(pco_shader *shader);
|
||||
bool pco_cf(pco_shader *shader);
|
||||
bool pco_dce(pco_shader *shader);
|
||||
bool pco_post_ra_legalize(pco_shader *shader);
|
||||
bool pco_end(pco_shader *shader);
|
||||
bool pco_group_instrs(pco_shader *shader);
|
||||
bool pco_index(pco_shader *shader, bool skip_ssa);
|
||||
|
|
|
|||
|
|
@ -55,6 +55,7 @@ void pco_process_ir(pco_ctx *ctx, pco_shader *shader)
|
|||
PCO_PASS(_, shader, pco_schedule);
|
||||
PCO_PASS(_, shader, pco_legalize);
|
||||
PCO_PASS(_, shader, pco_ra);
|
||||
PCO_PASS(_, shader, pco_post_ra_legalize);
|
||||
PCO_PASS(_, shader, pco_end);
|
||||
PCO_PASS(_, shader, pco_group_instrs);
|
||||
|
||||
|
|
|
|||
|
|
@ -396,6 +396,25 @@ static bool try_legalize_large_hwreg_offsets(pco_instr *instr,
|
|||
return true;
|
||||
}
|
||||
|
||||
static bool try_legalize_ditr_fence(pco_instr *instr)
|
||||
{
|
||||
if (instr->op != PCO_OP_DITR && instr->op != PCO_OP_DITRP)
|
||||
return false;
|
||||
|
||||
pco_builder b =
|
||||
pco_builder_create(instr->parent_func, pco_cursor_before_instr(instr));
|
||||
pco_flush_p0(&b);
|
||||
pco_br_next(&b, .exec_cnd = PCO_EXEC_CND_E1_Z1);
|
||||
pco_br_next(&b, .exec_cnd = PCO_EXEC_CND_E1_Z0);
|
||||
|
||||
b.cursor = pco_cursor_after_instr(instr);
|
||||
pco_flush_p0(&b);
|
||||
pco_br_next(&b, .exec_cnd = PCO_EXEC_CND_E1_Z1);
|
||||
pco_br_next(&b, .exec_cnd = PCO_EXEC_CND_E1_Z0);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Try to legalizes an instruction.
|
||||
*
|
||||
|
|
@ -441,3 +460,24 @@ bool pco_legalize(pco_shader *shader)
|
|||
shader->is_legalized = true;
|
||||
return progress;
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Post-RA legalization pass.
|
||||
*
|
||||
* \param[in,out] shader PCO shader.
|
||||
* \return True if the pass made progress.
|
||||
*/
|
||||
bool pco_post_ra_legalize(pco_shader *shader)
|
||||
{
|
||||
bool progress = false;
|
||||
|
||||
assert(!shader->is_grouped);
|
||||
|
||||
pco_foreach_func_in_shader (func, shader) {
|
||||
pco_foreach_instr_in_func_safe (instr, func) {
|
||||
progress |= try_legalize_ditr_fence(instr);
|
||||
}
|
||||
}
|
||||
|
||||
return progress;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,13 +44,6 @@ static pco_block *trans_cf_nodes(trans_ctx *tctx,
|
|||
struct list_head *cf_node_list,
|
||||
struct exec_list *nir_cf_node_list);
|
||||
|
||||
static inline void pco_fence(pco_builder *b)
|
||||
{
|
||||
pco_flush_p0(b);
|
||||
pco_br_next(b, .exec_cnd = PCO_EXEC_CND_E1_Z1);
|
||||
pco_br_next(b, .exec_cnd = PCO_EXEC_CND_E1_Z0);
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Splits a vector destination into scalar components.
|
||||
*
|
||||
|
|
@ -325,14 +318,8 @@ static inline pco_instr *build_itr(pco_builder *b,
|
|||
|
||||
pco_instr_set_itr_mode(instr, itr_mode);
|
||||
|
||||
if (d)
|
||||
pco_fence(b);
|
||||
|
||||
pco_builder_insert_instr(b, instr);
|
||||
|
||||
if (d)
|
||||
pco_fence(b);
|
||||
|
||||
return instr;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue