From 533d65786f43f23306c9e65d1d7022cf506a143f Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Fri, 19 Jul 2019 12:14:43 -0700 Subject: [PATCH] panfrost/midgard: Add mir_has_arg helper Helps scan the MIR for uses of an index. Signed-off-by: Alyssa Rosenzweig --- src/panfrost/midgard/compiler.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/panfrost/midgard/compiler.h b/src/panfrost/midgard/compiler.h index 294831c352e..3002a079dea 100644 --- a/src/panfrost/midgard/compiler.h +++ b/src/panfrost/midgard/compiler.h @@ -417,6 +417,18 @@ v_mov(unsigned src, midgard_vector_alu_src mod, unsigned dest) return ins; } +static inline bool +mir_has_arg(midgard_instruction *ins, unsigned arg) +{ + if (ins->ssa_args.src0 == arg) + return true; + + if (ins->ssa_args.src1 == arg && !ins->ssa_args.inline_constant) + return true; + + return false; +} + midgard_instruction v_load_store_scratch(unsigned srcdest, unsigned index, bool is_store); -- 2.30.2