radeonsi: use si_compiler::triple in si_llvm_optimize_module
authorMarek Olšák <marek.olsak@amd.com>
Mon, 9 Apr 2018 22:36:58 +0000 (18:36 -0400)
committerMarek Olšák <marek.olsak@amd.com>
Fri, 27 Apr 2018 21:56:04 +0000 (17:56 -0400)
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Tested-by: Benedikt Schemmer <ben at besd.de>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/gallium/drivers/radeonsi/si_shader_tgsi_setup.c

index cad81487d7e12dfae60b7cc56fdbdb4dbfb3a564..f354417b89e28d717516c5738fe10ca9156b12b9 100644 (file)
@@ -1213,7 +1213,6 @@ void si_llvm_create_func(struct si_shader_context *ctx,
 void si_llvm_optimize_module(struct si_shader_context *ctx)
 {
        struct gallivm_state *gallivm = &ctx->gallivm;
-       const char *triple = LLVMGetTarget(gallivm->module);
        LLVMTargetLibraryInfoRef target_library_info;
 
        /* Dump LLVM IR before any optimization passes */
@@ -1224,7 +1223,8 @@ void si_llvm_optimize_module(struct si_shader_context *ctx)
        /* Create the pass manager */
        gallivm->passmgr = LLVMCreatePassManager();
 
-       target_library_info = gallivm_create_target_library_info(triple);
+       target_library_info =
+               gallivm_create_target_library_info(ctx->compiler->triple);
        LLVMAddTargetLibraryInfo(target_library_info, gallivm->passmgr);
 
        if (si_extra_shader_checks(ctx->screen, ctx->type))