From: Alyssa Rosenzweig Date: Fri, 19 Jul 2019 19:14:43 +0000 (-0700) Subject: panfrost/midgard: Add mir_has_arg helper X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=533d65786f43f23306c9e65d1d7022cf506a143f;p=mesa.git panfrost/midgard: Add mir_has_arg helper Helps scan the MIR for uses of an index. Signed-off-by: Alyssa Rosenzweig --- 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);