radeonsi: use ac_get_llvm_processor_name
authorMarek Olšák <marek.olsak@amd.com>
Tue, 7 Nov 2017 02:43:38 +0000 (03:43 +0100)
committerMarek Olšák <marek.olsak@amd.com>
Tue, 7 Nov 2017 16:58:36 +0000 (17:58 +0100)
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/amd/common/ac_llvm_util.c
src/amd/common/ac_llvm_util.h
src/gallium/drivers/radeon/r600_pipe_common.c
src/gallium/drivers/radeon/r600_pipe_common.h
src/gallium/drivers/radeonsi/si_pipe.c

index 675926ea679bf64580a38d0e65417713d0a32b82..fb2bc11874398cf04130e319c8776e83ae271f8d 100644 (file)
@@ -74,7 +74,7 @@ LLVMTargetRef ac_get_llvm_target(const char *triple)
        return target;
 }
 
-static const char *ac_get_llvm_processor_name(enum radeon_family family)
+const char *ac_get_llvm_processor_name(enum radeon_family family)
 {
        switch (family) {
        case CHIP_TAHITI:
index cc4fe3bd632c8ae775c7215d9b5030d13575d542..d4b3915ffa9b9b5dbb687ff4be60a9f7f4f39d2c 100644 (file)
@@ -58,6 +58,8 @@ enum ac_target_machine_options {
        AC_TM_SUPPORTS_SPILL = (1 << 0),
        AC_TM_SISCHED = (1 << 1),
 };
+
+const char *ac_get_llvm_processor_name(enum radeon_family family);
 LLVMTargetMachineRef ac_create_target_machine(enum radeon_family family, enum ac_target_machine_options tm_options);
 
 LLVMTargetRef ac_get_llvm_target(const char *triple);
index 478f626b2995229d9898681c606dc2169f4c8031..aa72187c5706ebdfc01ca23b8339e7ad5756e9f5 100644 (file)
@@ -33,6 +33,7 @@
 #include "vl/vl_decoder.h"
 #include "vl/vl_video_buffer.h"
 #include "radeon/radeon_video.h"
+#include "amd/common/ac_llvm_util.h"
 #include "amd/common/sid.h"
 #include <inttypes.h>
 #include <sys/utsname.h>
@@ -996,40 +997,6 @@ static int r600_get_video_param(struct pipe_screen *screen,
        }
 }
 
-const char *si_get_llvm_processor_name(enum radeon_family family)
-{
-       switch (family) {
-       case CHIP_TAHITI: return "tahiti";
-       case CHIP_PITCAIRN: return "pitcairn";
-       case CHIP_VERDE: return "verde";
-       case CHIP_OLAND: return "oland";
-       case CHIP_HAINAN: return "hainan";
-       case CHIP_BONAIRE: return "bonaire";
-       case CHIP_KABINI: return "kabini";
-       case CHIP_KAVERI: return "kaveri";
-       case CHIP_HAWAII: return "hawaii";
-       case CHIP_MULLINS:
-               return "mullins";
-       case CHIP_TONGA: return "tonga";
-       case CHIP_ICELAND: return "iceland";
-       case CHIP_CARRIZO: return "carrizo";
-       case CHIP_FIJI:
-               return "fiji";
-       case CHIP_STONEY:
-               return "stoney";
-       case CHIP_POLARIS10:
-               return "polaris10";
-       case CHIP_POLARIS11:
-       case CHIP_POLARIS12: /* same as polaris11 */
-               return "polaris11";
-       case CHIP_VEGA10:
-       case CHIP_RAVEN:
-               return "gfx900";
-       default:
-               return "";
-       }
-}
-
 static unsigned get_max_threads_per_block(struct r600_common_screen *screen,
                                          enum pipe_shader_ir ir_type)
 {
@@ -1064,7 +1031,7 @@ static int r600_get_compute_param(struct pipe_screen *screen,
                else
                        triple = "amdgcn-mesa-mesa3d";
 
-               gpu = si_get_llvm_processor_name(rscreen->family);
+               gpu = ac_get_llvm_processor_name(rscreen->family);
                if (ret) {
                        sprintf(ret, "%s-%s", gpu, triple);
                }
index a7fec373fcf1ae368644c710cb02c5e0c3ce2d96..f803ee46339e402d5f6b1f08ac62651abe86c5bd 100644 (file)
@@ -717,7 +717,6 @@ void si_screen_clear_buffer(struct r600_common_screen *rscreen, struct pipe_reso
                            uint64_t offset, uint64_t size, unsigned value);
 struct pipe_resource *si_resource_create_common(struct pipe_screen *screen,
                                                const struct pipe_resource *templ);
-const char *si_get_llvm_processor_name(enum radeon_family family);
 void si_need_dma_space(struct r600_common_context *ctx, unsigned num_dw,
                       struct r600_resource *dst, struct r600_resource *src);
 void si_save_cs(struct radeon_winsys *ws, struct radeon_winsys_cs *cs,
index 649a72e0fcf854e3d183cfe13182df46e12e067b..e96380ce40aefbe57e91f9dd3ca593b34cfdf505 100644 (file)
@@ -155,7 +155,7 @@ si_create_llvm_target_machine(struct si_screen *sscreen)
                 sscreen->b.debug_flags & DBG(SI_SCHED) ? ",+si-scheduler" : "");
 
        return LLVMCreateTargetMachine(ac_get_llvm_target(triple), triple,
-                                      si_get_llvm_processor_name(sscreen->b.family),
+                                      ac_get_llvm_processor_name(sscreen->b.family),
                                       features,
                                       LLVMCodeGenLevelDefault,
                                       LLVMRelocDefault,
@@ -907,7 +907,7 @@ static void si_handle_env_var_force_family(struct si_screen *sscreen)
                return;
 
        for (i = CHIP_TAHITI; i < CHIP_LAST; i++) {
-               if (!strcmp(family, si_get_llvm_processor_name(i))) {
+               if (!strcmp(family, ac_get_llvm_processor_name(i))) {
                        /* Override family and chip_class. */
                        sscreen->b.family = sscreen->b.info.family = i;