summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Stellard <[email protected]>2016-02-04 02:34:55 +0000
committerTom Stellard <[email protected]>2016-02-17 19:06:41 +0000
commit4f351a6cb1cc5ac6dfb9005c386fcbce7e61ac03 (patch)
tree5911a1b1eaec30ebc3064026320c552294184045
parent77f4e1c7ffeb9c98957f0f22c872f8ca7f93970d (diff)
radeon/llvm: Set the target triple on the module
Tested-by: Michel Dänzer <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
-rw-r--r--src/gallium/drivers/r600/r600_llvm.c2
-rw-r--r--src/gallium/drivers/radeon/radeon_llvm.h3
-rw-r--r--src/gallium/drivers/radeon/radeon_setup_tgsi_llvm.c9
-rw-r--r--src/gallium/drivers/radeonsi/si_shader.c2
4 files changed, 12 insertions, 4 deletions
diff --git a/src/gallium/drivers/r600/r600_llvm.c b/src/gallium/drivers/r600/r600_llvm.c
index 0fe7c74418d..981bb12f900 100644
--- a/src/gallium/drivers/r600/r600_llvm.c
+++ b/src/gallium/drivers/r600/r600_llvm.c
@@ -784,7 +784,7 @@ LLVMModuleRef r600_tgsi_llvm(
{
struct tgsi_shader_info shader_info;
struct lp_build_tgsi_context * bld_base = &ctx->soa.bld_base;
- radeon_llvm_context_init(ctx);
+ radeon_llvm_context_init(ctx, "r600--");
LLVMTypeRef Arguments[32];
unsigned ArgumentsCount = 0;
for (unsigned i = 0; i < ctx->inputs_count; i++)
diff --git a/src/gallium/drivers/radeon/radeon_llvm.h b/src/gallium/drivers/radeon/radeon_llvm.h
index e967ad2214e..9f7d03909e9 100644
--- a/src/gallium/drivers/radeon/radeon_llvm.h
+++ b/src/gallium/drivers/radeon/radeon_llvm.h
@@ -158,7 +158,8 @@ void radeon_llvm_emit_prepare_cube_coords(struct lp_build_tgsi_context * bld_bas
LLVMValueRef *coords_arg,
LLVMValueRef *derivs_arg);
-void radeon_llvm_context_init(struct radeon_llvm_context * ctx);
+void radeon_llvm_context_init(struct radeon_llvm_context * ctx,
+ const char *triple);
void radeon_llvm_create_func(struct radeon_llvm_context * ctx,
LLVMTypeRef *ParamTypes, unsigned ParamCount);
diff --git a/src/gallium/drivers/radeon/radeon_setup_tgsi_llvm.c b/src/gallium/drivers/radeon/radeon_setup_tgsi_llvm.c
index f5e3f6af1a0..73bc84988c4 100644
--- a/src/gallium/drivers/radeon/radeon_setup_tgsi_llvm.c
+++ b/src/gallium/drivers/radeon/radeon_setup_tgsi_llvm.c
@@ -1520,7 +1520,7 @@ static void emit_up2h(const struct lp_build_tgsi_action *action,
}
}
-void radeon_llvm_context_init(struct radeon_llvm_context * ctx)
+void radeon_llvm_context_init(struct radeon_llvm_context * ctx, const char *triple)
{
struct lp_type type;
@@ -1534,6 +1534,13 @@ void radeon_llvm_context_init(struct radeon_llvm_context * ctx)
ctx->gallivm.context = LLVMContextCreate();
ctx->gallivm.module = LLVMModuleCreateWithNameInContext("tgsi",
ctx->gallivm.context);
+ LLVMSetTarget(ctx->gallivm.module,
+
+#if HAVE_LLVM < 0x0306
+ "r600--");
+#else
+ triple);
+#endif
ctx->gallivm.builder = LLVMCreateBuilderInContext(ctx->gallivm.context);
struct lp_build_tgsi_context * bld_base = &ctx->soa.bld_base;
diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c
index 19c427a1bb9..d1482de209d 100644
--- a/src/gallium/drivers/radeonsi/si_shader.c
+++ b/src/gallium/drivers/radeonsi/si_shader.c
@@ -4323,7 +4323,7 @@ static void si_init_shader_ctx(struct si_shader_context *ctx,
struct lp_build_tgsi_context *bld_base;
memset(ctx, 0, sizeof(*ctx));
- radeon_llvm_context_init(&ctx->radeon_bld);
+ radeon_llvm_context_init(&ctx->radeon_bld, "amdgcn--");
ctx->tm = tm;
ctx->screen = sscreen;
if (shader && shader->selector)