diff options
author | Alyssa Rosenzweig <[email protected]> | 2020-03-19 17:21:34 -0400 |
---|---|---|
committer | Marge Bot <[email protected]> | 2020-03-22 03:32:34 +0000 |
commit | 58a51c49bbf48e92a78355401a07fd3870c1746c (patch) | |
tree | c5e7234ca9d44c1b36c534c04cfda1990286e07e | |
parent | 6b7077efda9a8b518c7f55f497504a031c623e54 (diff) |
pan/bi: Add bi_emit_before helper
For BIR lowering passes.
Signed-off-by: Alyssa Rosenzweig <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4276>
-rw-r--r-- | src/panfrost/bifrost/compiler.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/panfrost/bifrost/compiler.h b/src/panfrost/bifrost/compiler.h index d7d80d5c8a9..17834614672 100644 --- a/src/panfrost/bifrost/compiler.h +++ b/src/panfrost/bifrost/compiler.h @@ -366,6 +366,15 @@ bi_emit(bi_context *ctx, bi_instruction ins) return u; } +static inline bi_instruction * +bi_emit_before(bi_context *ctx, bi_instruction *tag, bi_instruction ins) +{ + bi_instruction *u = rzalloc(ctx, bi_instruction); + memcpy(u, &ins, sizeof(ins)); + list_addtail(&u->link, &tag->link); + return u; +} + static inline void bi_remove_instruction(bi_instruction *ins) { |