From 664ab228dabd4e8b66d59d39644a0a59fdcb3045 Mon Sep 17 00:00:00 2001 From: Simon Perretta Date: Wed, 28 May 2025 22:39:20 +0100 Subject: [PATCH] pco: temporarily don't propagate pixout accesses in opt Signed-off-by: Simon Perretta Acked-by: Erik Faye-Lund Part-of: --- src/imagination/pco/pco_opt.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/imagination/pco/pco_opt.c b/src/imagination/pco/pco_opt.c index 85f268ddc16..cd5b97ace5e 100644 --- a/src/imagination/pco/pco_opt.c +++ b/src/imagination/pco/pco_opt.c @@ -260,6 +260,8 @@ static inline bool try_back_prop_instr(struct pco_use *uses, pco_instr *instr) if (pco_ref_is_reg(*pdest_from) && pco_ref_get_reg_class(*pdest_from) == PCO_REG_CLASS_PIXOUT) { + return false; + bool has_isp_fb = false; pco_foreach_instr_in_func_from_rev (rev_instr, use->instr) { @@ -274,6 +276,14 @@ static inline bool try_back_prop_instr(struct pco_use *uses, pco_instr *instr) if (has_isp_fb) return false; + + /* Don't move pixout regs into instructions that already use them. */ + pco_foreach_instr_src (psrc, instr) { + if (pco_ref_is_reg(*psrc) && + pco_ref_get_reg_class(*psrc) == PCO_REG_CLASS_PIXOUT) { + return false; + } + } } assert(pco_ref_get_bits(*pdest_from) == pco_ref_get_bits(*pdest_to)); @@ -373,6 +383,11 @@ static inline bool can_fwd_prop_src(const pco_instr *to_instr, * feature/arch-agnostic. */ + if (pco_ref_is_reg(*from) && + pco_ref_get_reg_class(*from) == PCO_REG_CLASS_PIXOUT) { + return false; + } + return true; }