radeonsi: remove si_llvm_add_attribute
authorMarek Olšák <marek.olsak@amd.com>
Sat, 24 Feb 2018 23:39:44 +0000 (00:39 +0100)
committerMarek Olšák <marek.olsak@amd.com>
Wed, 7 Mar 2018 18:55:49 +0000 (13:55 -0500)
src/gallium/drivers/radeonsi/si_shader.c
src/gallium/drivers/radeonsi/si_shader_internal.h
src/gallium/drivers/radeonsi/si_shader_tgsi_setup.c

index d95e69f81adb5b465ae592ea6ddfb34a01e67dca..343a5d57bf38132d4d53508bdb8837de58a7e213 100644 (file)
@@ -4463,8 +4463,9 @@ static void si_create_function(struct si_shader_context *ctx,
        }
 
        if (max_workgroup_size) {
-               si_llvm_add_attribute(ctx->main_fn, "amdgpu-max-work-group-size",
-                                     max_workgroup_size);
+               ac_llvm_add_target_dep_function_attr(ctx->main_fn,
+                                                    "amdgpu-max-work-group-size",
+                                                    max_workgroup_size);
        }
        LLVMAddTargetDependentFunctionAttr(ctx->main_fn,
                                           "no-signed-zeros-fp-math",
@@ -5006,17 +5007,17 @@ static void create_function(struct si_shader_context *ctx)
        /* Reserve register locations for VGPR inputs the PS prolog may need. */
        if (ctx->type == PIPE_SHADER_FRAGMENT &&
            ctx->separate_prolog) {
-               si_llvm_add_attribute(ctx->main_fn,
-                                     "InitialPSInputAddr",
-                                     S_0286D0_PERSP_SAMPLE_ENA(1) |
-                                     S_0286D0_PERSP_CENTER_ENA(1) |
-                                     S_0286D0_PERSP_CENTROID_ENA(1) |
-                                     S_0286D0_LINEAR_SAMPLE_ENA(1) |
-                                     S_0286D0_LINEAR_CENTER_ENA(1) |
-                                     S_0286D0_LINEAR_CENTROID_ENA(1) |
-                                     S_0286D0_FRONT_FACE_ENA(1) |
-                                     S_0286D0_ANCILLARY_ENA(1) |
-                                     S_0286D0_POS_FIXED_PT_ENA(1));
+               ac_llvm_add_target_dep_function_attr(ctx->main_fn,
+                                                    "InitialPSInputAddr",
+                                                    S_0286D0_PERSP_SAMPLE_ENA(1) |
+                                                    S_0286D0_PERSP_CENTER_ENA(1) |
+                                                    S_0286D0_PERSP_CENTROID_ENA(1) |
+                                                    S_0286D0_LINEAR_SAMPLE_ENA(1) |
+                                                    S_0286D0_LINEAR_CENTER_ENA(1) |
+                                                    S_0286D0_LINEAR_CENTROID_ENA(1) |
+                                                    S_0286D0_FRONT_FACE_ENA(1) |
+                                                    S_0286D0_ANCILLARY_ENA(1) |
+                                                    S_0286D0_POS_FIXED_PT_ENA(1));
        }
 
        shader->info.num_input_sgprs = 0;
@@ -7791,8 +7792,8 @@ static void si_build_ps_epilog_function(struct si_shader_context *ctx,
        /* Create the function. */
        si_create_function(ctx, "ps_epilog", NULL, 0, &fninfo, 0);
        /* Disable elimination of unused inputs. */
-       si_llvm_add_attribute(ctx->main_fn,
-                                 "InitialPSInputAddr", 0xffffff);
+       ac_llvm_add_target_dep_function_attr(ctx->main_fn,
+                                            "InitialPSInputAddr", 0xffffff);
 
        /* Process colors. */
        unsigned vgpr = fninfo.num_sgpr_params;
index dc7351701814d5719d2f7e60d76e5c2a9576eb41..157dd466b46c4d4815aaf59d3114590743727ed5 100644 (file)
@@ -227,8 +227,6 @@ si_shader_context_from_abi(struct ac_shader_abi *abi)
        return container_of(abi, ctx, abi);
 }
 
-void si_llvm_add_attribute(LLVMValueRef F, const char *name, int value);
-
 unsigned si_llvm_compile(LLVMModuleRef M, struct ac_shader_binary *binary,
                         LLVMTargetMachineRef tm,
                         struct pipe_debug_callback *debug);
index 4a027d86592b6499b70dcc3e588a1f71ba3d8c29..f060ad68edbce14912a3d3c15cb479c55ebe8f80 100644 (file)
@@ -57,14 +57,6 @@ enum si_llvm_calling_convention {
        RADEON_LLVM_AMDGPU_HS = 93,
 };
 
-void si_llvm_add_attribute(LLVMValueRef F, const char *name, int value)
-{
-       char str[16];
-
-       snprintf(str, sizeof(str), "%i", value);
-       LLVMAddTargetDependentFunctionAttr(F, name, str);
-}
-
 struct si_llvm_diagnostics {
        struct pipe_debug_callback *debug;
        unsigned retval;