From a201e21b4e55a6e33a482a0adcfb30cd38307b0c Mon Sep 17 00:00:00 2001 From: Simon Perretta Date: Tue, 1 Jul 2025 15:58:38 +0100 Subject: [PATCH] pco: legalize between movs1/mbyp without emitting additional ops Signed-off-by: Simon Perretta Acked-by: Erik Faye-Lund Part-of: --- src/imagination/pco/pco_legalize.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/imagination/pco/pco_legalize.c b/src/imagination/pco/pco_legalize.c index f940ee52497..3654e2db099 100644 --- a/src/imagination/pco/pco_legalize.c +++ b/src/imagination/pco/pco_legalize.c @@ -51,6 +51,14 @@ static inline bool ref_needs_olchk(pco_ref ref) */ static void insert_mov_ref(pco_instr *instr, pco_ref *ref, bool needs_s124) { + if (instr->op == PCO_OP_MBYP && needs_s124 && !pco_ref_has_mods_set(*ref)) { + instr->op = PCO_OP_MOVS1; + return; + } else if (instr->op == PCO_OP_MOVS1 && !needs_s124) { + instr->op = PCO_OP_MBYP; + return; + } + assert(pco_ref_is_scalar(*ref)); pco_ref new_ref = pco_ref_new_ssa(instr->parent_func, pco_ref_get_bits(*ref),