From 28622f90882d9e13530bea9547a0793b1f4e7236 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Fri, 30 Aug 2019 10:46:17 -0700 Subject: pan/midgard: Add mir_insert_instruction*scheduled helpers In order to run register allocation after scheduling, it is sometimes necessary to be able to insert instructions into an already-scheduled program. This is suboptimal, since it forces us to do a worst-case scheduling, but it is nevertheless required for correct handling of spills/fills. Let's add helpers to insert instructions as standalone bundles for use in spilling code. These helpers are minimal -- they *only* work on load/store ops or moves. They should not be used for anything but register spilling; any other instructions should be added prior to the schedule. Signed-off-by: Alyssa Rosenzweig --- src/panfrost/midgard/compiler.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/panfrost/midgard/compiler.h') diff --git a/src/panfrost/midgard/compiler.h b/src/panfrost/midgard/compiler.h index 0c9d329c6bf..cc63b6ce7c7 100644 --- a/src/panfrost/midgard/compiler.h +++ b/src/panfrost/midgard/compiler.h @@ -520,6 +520,9 @@ bool mir_nontrivial_source2_mod_simple(midgard_instruction *ins); bool mir_nontrivial_mod(midgard_vector_alu_src src, bool is_int, unsigned mask); bool mir_nontrivial_outmod(midgard_instruction *ins); +void mir_insert_instruction_before_scheduled(compiler_context *ctx, midgard_block *block, midgard_instruction *tag, midgard_instruction ins); +void mir_insert_instruction_after_scheduled(compiler_context *ctx, midgard_block *block, midgard_instruction *tag, midgard_instruction ins); + /* MIR goodies */ static const midgard_vector_alu_src blank_alu_src = { -- cgit v1.2.3