diff options
author | Alyssa Rosenzweig <[email protected]> | 2019-07-19 12:14:43 -0700 |
---|---|---|
committer | Alyssa Rosenzweig <[email protected]> | 2019-07-22 08:20:34 -0700 |
commit | 533d65786f43f23306c9e65d1d7022cf506a143f (patch) | |
tree | 11022a23135451a0881bde1e1ee6f6143772f7d2 /src/panfrost/midgard | |
parent | 076838ef0cba3bffd8d89a02146c2fcf18c30871 (diff) |
panfrost/midgard: Add mir_has_arg helper
Helps scan the MIR for uses of an index.
Signed-off-by: Alyssa Rosenzweig <[email protected]>
Diffstat (limited to 'src/panfrost/midgard')
-rw-r--r-- | src/panfrost/midgard/compiler.h | 12 |
1 files changed, 12 insertions, 0 deletions
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); |