From 2537a53d5cc1f992366c9b7c5ea2781cc7913f5a Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Wed, 6 Jan 2021 17:39:44 -0500 Subject: [PATCH] pan/bi: Add writes_reg predicate ATEST is a bit of a wrinkle in this, so let's keep it in one place. Signed-off-by: Alyssa Rosenzweig Reviewed-by: Boris Brezillon Part-of: --- src/panfrost/bifrost/bi_schedule.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/panfrost/bifrost/bi_schedule.c b/src/panfrost/bifrost/bi_schedule.c index b9ab2cbb283..d1a9cd4d934 100644 --- a/src/panfrost/bifrost/bi_schedule.c +++ b/src/panfrost/bifrost/bi_schedule.c @@ -666,6 +666,17 @@ bi_has_cross_passthrough_hazard(bi_tuple *succ, bi_instr *ins) return false; } +/* Is a register written other than the staging mechanism? ATEST is special, + * writing to both a staging register and a regular register (fixed packing)*/ + +static bool +bi_writes_reg(bi_instr *instr) +{ + return (instr->op == BI_OPCODE_ATEST) || + (!bi_is_null(instr->dest[0]) && + !bi_opcode_props[instr->op].sr_write); +} + #ifndef NDEBUG static bi_builder *