[Mesa-dev] [PATCH 08/11] radv/radeonsi: add a check ir tm options
Dave Airlie
airlied at gmail.com
Tue Jul 3 00:42:21 UTC 2018
From: Dave Airlie <airlied at redhat.com>
This doesn't do much yet, but it makes it easier to move the code
to a common shared code base.
---
src/amd/common/ac_llvm_util.h | 1 +
src/amd/vulkan/radv_shader.c | 4 +++-
src/gallium/drivers/radeonsi/si_pipe.c | 5 +++--
3 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/src/amd/common/ac_llvm_util.h b/src/amd/common/ac_llvm_util.h
index 6e9814ad3eb..6269bee7d98 100644
--- a/src/amd/common/ac_llvm_util.h
+++ b/src/amd/common/ac_llvm_util.h
@@ -59,6 +59,7 @@ enum ac_target_machine_options {
AC_TM_FORCE_ENABLE_XNACK = (1 << 2),
AC_TM_FORCE_DISABLE_XNACK = (1 << 3),
AC_TM_PROMOTE_ALLOCA_TO_SCRATCH = (1 << 4),
+ AC_TM_CHECK_IR = (1 << 5),
};
enum ac_float_mode {
diff --git a/src/amd/vulkan/radv_shader.c b/src/amd/vulkan/radv_shader.c
index 17d824c94df..7b822ff3628 100644
--- a/src/amd/vulkan/radv_shader.c
+++ b/src/amd/vulkan/radv_shader.c
@@ -562,10 +562,12 @@ shader_variant_create(struct radv_device *device,
tm_options |= AC_TM_SUPPORTS_SPILL;
if (device->instance->perftest_flags & RADV_PERFTEST_SISCHED)
tm_options |= AC_TM_SISCHED;
+ if (options->check_ir)
+ tm_options |= AC_TM_CHECK_IR;
radv_init_llvm_once();
tm = ac_create_target_machine(chip_family, tm_options, NULL);
- passmgr = ac_init_passmgr(NULL, options->check_ir);
+ passmgr = ac_init_passmgr(NULL, tm_options & AC_TM_CHECK_IR);
if (gs_copy_shader) {
assert(shader_count == 1);
radv_compile_gs_copy_shader(tm, passmgr, *shaders, &binary,
diff --git a/src/gallium/drivers/radeonsi/si_pipe.c b/src/gallium/drivers/radeonsi/si_pipe.c
index 42834486bf3..91ddcf7a5ba 100644
--- a/src/gallium/drivers/radeonsi/si_pipe.c
+++ b/src/gallium/drivers/radeonsi/si_pipe.c
@@ -111,7 +111,8 @@ static void si_init_compiler(struct si_screen *sscreen,
(sscreen->debug_flags & DBG(SI_SCHED) ? AC_TM_SISCHED : 0) |
(sscreen->info.chip_class >= GFX9 ? AC_TM_FORCE_ENABLE_XNACK : 0) |
(sscreen->info.chip_class < GFX9 ? AC_TM_FORCE_DISABLE_XNACK : 0) |
- (!sscreen->llvm_has_working_vgpr_indexing ? AC_TM_PROMOTE_ALLOCA_TO_SCRATCH : 0);
+ (!sscreen->llvm_has_working_vgpr_indexing ? AC_TM_PROMOTE_ALLOCA_TO_SCRATCH : 0) |
+ (sscreen->debug_flags & DBG(CHECK_IR) ? AC_TM_CHECK_IR : 0);
const char *triple;
ac_init_llvm_once();
@@ -126,7 +127,7 @@ static void si_init_compiler(struct si_screen *sscreen,
return;
compiler->passmgr = ac_init_passmgr(compiler->target_library_info,
- (sscreen->debug_flags & DBG(CHECK_IR)));
+ tm_options & AC_TM_CHECK_IR);
if (!compiler->passmgr)
return;
}
--
2.17.1
More information about the mesa-dev
mailing list