aco: Only include nir.h in instruction selection.
authorTimur Kristóf <timur.kristof@gmail.com>
Fri, 31 Mar 2023 19:59:33 +0000 (21:59 +0200)
committerMarge Bot <emma+marge@anholt.net>
Mon, 10 Apr 2023 20:01:28 +0000 (20:01 +0000)
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 <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22241>

src/amd/compiler/aco_insert_NOPs.cpp
src/amd/compiler/aco_instruction_selection.h
src/amd/compiler/aco_interface.h
src/amd/compiler/aco_ir.h
src/amd/compiler/aco_lower_phis.cpp
src/amd/compiler/aco_print_asm.cpp
src/amd/compiler/aco_register_allocation.cpp
src/amd/compiler/aco_shader_info.h
src/amd/compiler/aco_validate.cpp

index 243388a..8e4decd 100644 (file)
@@ -25,6 +25,8 @@
 #include "aco_builder.h"
 #include "aco_ir.h"
 
+#include "util/bitset.h"
+
 #include <algorithm>
 #include <bitset>
 #include <set>
index 31bb55b..acb2541 100644 (file)
@@ -27,6 +27,8 @@
 
 #include "aco_ir.h"
 
+#include "nir.h"
+
 #include <array>
 #include <unordered_map>
 #include <vector>
index e9319e4..8177838 100644 (file)
@@ -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;
index 122221e..a282dc5 100644 (file)
 #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 <algorithm>
 #include <bitset>
 #include <memory>
 #include <vector>
 
+typedef struct nir_shader nir_shader;
+
 namespace aco {
 
 extern uint64_t debug_flags;
index f20f4f3..b9b44e8 100644 (file)
@@ -25,6 +25,8 @@
 #include "aco_builder.h"
 #include "aco_ir.h"
 
+#include "util/enum_operators.h"
+
 #include <algorithm>
 #include <map>
 #include <vector>
index ecfdb95..8ee2475 100644 (file)
@@ -24,6 +24,8 @@
 
 #include "aco_ir.h"
 
+#include "util/u_debug.h"
+
 #ifdef LLVM_AVAILABLE
 #if defined(_MSC_VER) && defined(restrict)
 #undef restrict
index a0cf33a..ed05b34 100644 (file)
 
 #include "aco_ir.h"
 
+#include "util/enum_operators.h"
+
 #include <algorithm>
 #include <array>
 #include <bitset>
 #include <map>
+#include <optional>
 #include <set>
 #include <unordered_map>
 #include <vector>
-#include <optional>
 
 namespace aco {
 namespace {
index f4810a9..7b92213 100644 (file)
@@ -28,6 +28,7 @@
 #define ACO_SHADER_INFO_H
 
 #include "ac_shader_args.h"
+#include "amd_family.h"
 #include "shader_enums.h"
 
 #ifdef __cplusplus
index f87fcdb..abf0a59 100644 (file)
@@ -25,6 +25,7 @@
 #include "aco_ir.h"
 
 #include "util/memstream.h"
+#include "util/ralloc.h"
 
 #include <array>
 #include <map>