From 2ff12679591d3ccbd16f3f5de8a88f6a97275715 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Timur=20Krist=C3=B3f?= Date: Fri, 31 Mar 2023 21:59:33 +0200 Subject: [PATCH] aco: Only include nir.h in instruction selection. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Don't recompile entire ACO when something changes in NIR. Instead, only use some headers which are actually needed, include these in ACO files instead of relying on nir.h to include them. Signed-off-by: Timur Kristóf Reviewed-by: Rhys Perry Part-of: --- src/amd/compiler/aco_insert_NOPs.cpp | 2 ++ src/amd/compiler/aco_instruction_selection.h | 2 ++ src/amd/compiler/aco_interface.h | 3 +-- src/amd/compiler/aco_ir.h | 6 ++++-- src/amd/compiler/aco_lower_phis.cpp | 2 ++ src/amd/compiler/aco_print_asm.cpp | 2 ++ src/amd/compiler/aco_register_allocation.cpp | 4 +++- src/amd/compiler/aco_shader_info.h | 1 + src/amd/compiler/aco_validate.cpp | 1 + 9 files changed, 18 insertions(+), 5 deletions(-) diff --git a/src/amd/compiler/aco_insert_NOPs.cpp b/src/amd/compiler/aco_insert_NOPs.cpp index 243388a..8e4decd 100644 --- a/src/amd/compiler/aco_insert_NOPs.cpp +++ b/src/amd/compiler/aco_insert_NOPs.cpp @@ -25,6 +25,8 @@ #include "aco_builder.h" #include "aco_ir.h" +#include "util/bitset.h" + #include #include #include diff --git a/src/amd/compiler/aco_instruction_selection.h b/src/amd/compiler/aco_instruction_selection.h index 31bb55b..acb2541 100644 --- a/src/amd/compiler/aco_instruction_selection.h +++ b/src/amd/compiler/aco_instruction_selection.h @@ -27,6 +27,8 @@ #include "aco_ir.h" +#include "nir.h" + #include #include #include diff --git a/src/amd/compiler/aco_interface.h b/src/amd/compiler/aco_interface.h index e9319e4..8177838 100644 --- a/src/amd/compiler/aco_interface.h +++ b/src/amd/compiler/aco_interface.h @@ -25,8 +25,6 @@ #ifndef ACO_INTERFACE_H #define ACO_INTERFACE_H -#include "nir.h" - #include "amd_family.h" #include "aco_shader_info.h" @@ -34,6 +32,7 @@ extern "C" { #endif +typedef struct nir_shader nir_shader; struct ac_shader_config; struct aco_shader_info; struct aco_vs_prolog_info; diff --git a/src/amd/compiler/aco_ir.h b/src/amd/compiler/aco_ir.h index 122221e..a282dc5 100644 --- a/src/amd/compiler/aco_ir.h +++ b/src/amd/compiler/aco_ir.h @@ -25,19 +25,21 @@ #ifndef ACO_IR_H #define ACO_IR_H -#include "aco_interface.h" #include "aco_opcodes.h" #include "aco_shader_info.h" #include "aco_util.h" -#include "nir.h" +#include "util/compiler.h" #include "ac_binary.h" +#include "amd_family.h" #include #include #include #include +typedef struct nir_shader nir_shader; + namespace aco { extern uint64_t debug_flags; diff --git a/src/amd/compiler/aco_lower_phis.cpp b/src/amd/compiler/aco_lower_phis.cpp index f20f4f3..b9b44e8 100644 --- a/src/amd/compiler/aco_lower_phis.cpp +++ b/src/amd/compiler/aco_lower_phis.cpp @@ -25,6 +25,8 @@ #include "aco_builder.h" #include "aco_ir.h" +#include "util/enum_operators.h" + #include #include #include diff --git a/src/amd/compiler/aco_print_asm.cpp b/src/amd/compiler/aco_print_asm.cpp index ecfdb95..8ee2475 100644 --- a/src/amd/compiler/aco_print_asm.cpp +++ b/src/amd/compiler/aco_print_asm.cpp @@ -24,6 +24,8 @@ #include "aco_ir.h" +#include "util/u_debug.h" + #ifdef LLVM_AVAILABLE #if defined(_MSC_VER) && defined(restrict) #undef restrict diff --git a/src/amd/compiler/aco_register_allocation.cpp b/src/amd/compiler/aco_register_allocation.cpp index a0cf33a..ed05b34 100644 --- a/src/amd/compiler/aco_register_allocation.cpp +++ b/src/amd/compiler/aco_register_allocation.cpp @@ -24,14 +24,16 @@ #include "aco_ir.h" +#include "util/enum_operators.h" + #include #include #include #include +#include #include #include #include -#include namespace aco { namespace { diff --git a/src/amd/compiler/aco_shader_info.h b/src/amd/compiler/aco_shader_info.h index f4810a9..7b92213 100644 --- a/src/amd/compiler/aco_shader_info.h +++ b/src/amd/compiler/aco_shader_info.h @@ -28,6 +28,7 @@ #define ACO_SHADER_INFO_H #include "ac_shader_args.h" +#include "amd_family.h" #include "shader_enums.h" #ifdef __cplusplus diff --git a/src/amd/compiler/aco_validate.cpp b/src/amd/compiler/aco_validate.cpp index f87fcdb..abf0a59 100644 --- a/src/amd/compiler/aco_validate.cpp +++ b/src/amd/compiler/aco_validate.cpp @@ -25,6 +25,7 @@ #include "aco_ir.h" #include "util/memstream.h" +#include "util/ralloc.h" #include #include -- 2.7.4