radv: pass radv_nir_compiler_options directly to create_llvm_function()
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Fri, 18 May 2018 08:43:06 +0000 (10:43 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Fri, 18 May 2018 09:07:01 +0000 (11:07 +0200)
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
src/amd/vulkan/radv_nir_to_llvm.c

index 1384bf0bdba4491d9e08a8471ecf8212a26a4cff..9b9619b877ea02cd97a802f9556ddad2ece3dc0f 100644 (file)
@@ -480,7 +480,7 @@ create_llvm_function(LLVMContextRef ctx, LLVMModuleRef module,
                      unsigned num_return_elems,
                     struct arg_info *args,
                     unsigned max_workgroup_size,
-                    bool unsafe_math)
+                    const struct radv_nir_compiler_options *options)
 {
        LLVMTypeRef main_function_type, ret_type;
        LLVMBasicBlockRef main_function_body;
@@ -516,7 +516,7 @@ create_llvm_function(LLVMContextRef ctx, LLVMModuleRef module,
                                                     "amdgpu-max-work-group-size",
                                                     max_workgroup_size);
        }
-       if (unsafe_math) {
+       if (options->unsafe_math) {
                /* These were copied from some LLVM test. */
                LLVMAddTargetDependentFunctionAttr(main_function,
                                                   "less-precise-fpmad",
@@ -1106,8 +1106,7 @@ static void create_function(struct radv_shader_context *ctx,
 
        ctx->main_function = create_llvm_function(
            ctx->context, ctx->ac.module, ctx->ac.builder, NULL, 0, &args,
-           ctx->max_workgroup_size,
-           ctx->options->unsafe_math);
+           ctx->max_workgroup_size, ctx->options);
        set_llvm_calling_convention(ctx->main_function, stage);