radeon/llvm: Set the target triple on the module

Tested-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
This commit is contained in:
Tom Stellard 2016-02-04 02:34:55 +00:00
parent 77f4e1c7ff
commit 4f351a6cb1
4 changed files with 12 additions and 4 deletions

View File

@ -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++)

View File

@ -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);

View File

@ -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;

View File

@ -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)