<div dir="ltr"><div>Adding this:<br><br>diff --git a/meson.build b/meson.build<br>index 80ea60f..22eb702 100644<br>--- a/meson.build<br>+++ b/meson.build<br>@@ -991,12 +991,12 @@ endif<br> _llvm = get_option('llvm')<br> if _llvm == 'auto'<br>   dep_llvm = dependency(<br>-    'llvm', version : '>= 3.9.0', modules : llvm_modules,<br>+    'llvm', version : '>= 4.0.0', modules : llvm_modules,<br>     required : with_amd_vk or with_gallium_radeonsi or with_gallium_swr or with_gallium_opencl,<br>   )<br>   with_llvm = dep_llvm.found()<br> elif _llvm == 'true'<br>-  dep_llvm = dependency('llvm', version : '>= 3.9.0', modules : llvm_modules)<br>+  dep_llvm = dependency('llvm', version : '>= 4.0.0', modules : llvm_modules)<br>   with_llvm = true<br> else<br>   dep_llvm = []<br>@@ -1019,7 +1019,7 @@ if with_llvm<br>     '-DMESA_LLVM_VERSION_PATCH=@0@'.format(_llvm_patch),<br>   ]<br> elif with_amd_vk or with_gallium_radeonsi or with_gallium_swr<br>-  error('The following drivers requires LLVM: Radv, RadeonSI, SWR. One of these is enabled, but LLVM is disabled.')<br>+  error('The following drivers require LLVM: Radv, RadeonSI, SWR. One of these is enabled, but LLVM is disabled.')<br> endif<br> <br> dep_glvnd = []<br><br></div>Marek<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Feb 2, 2018 at 8:02 PM, Bas Nieuwenhuizen <span dir="ltr"><<a href="mailto:bas@basnieuwenhuizen.nl" target="_blank">bas@basnieuwenhuizen.nl</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Also change meson.build?<br>
<div><div class="h5"><br>
On Fri, Feb 2, 2018 at 7:34 PM, Marek Olšák <<a href="mailto:maraeo@gmail.com">maraeo@gmail.com</a>> wrote:<br>
> From: Marek Olšák <<a href="mailto:marek.olsak@amd.com">marek.olsak@amd.com</a>><br>
><br>
> Only these are supported:<br>
> - LLVM 4.0<br>
> - LLVM 5.0<br>
> - LLVM 6.0<br>
> - master (7.0)<br>
> ---<br>
>  <a href="http://configure.ac" rel="noreferrer" target="_blank">configure.ac</a>  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â |  Â 4 +-<br>
>  src/amd/common/ac_llvm_build.c  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â | 187 ++++++---------------<br>
>  src/amd/common/ac_llvm_helper.<wbr>cpp  Â  Â  Â  Â  Â  Â  Â  Â  |  10 --<br>
>  src/amd/common/ac_llvm_util.c  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  |  39 +----<br>
>  src/amd/common/ac_llvm_util.h  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  |  14 +-<br>
>  src/amd/common/ac_nir_to_llvm.<wbr>c  Â  Â  Â  Â  Â  Â  Â  Â  Â  |  32 +---<br>
>  src/amd/vulkan/radv_device.c  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â |  Â 4 -<br>
>  src/gallium/drivers/radeonsi/<wbr>si_compute.c  Â  Â  Â  Â  |  Â 3 +-<br>
>  src/gallium/drivers/radeonsi/<wbr>si_get.c  Â  Â  Â  Â  Â  Â  |  13 +-<br>
>  src/gallium/drivers/radeonsi/<wbr>si_shader_tgsi_mem.c  |  Â 3 +-<br>
>  .../drivers/radeonsi/si_<wbr>shader_tgsi_setup.c  Â  Â  Â  |  Â 2 -<br>
>  11 files changed, 72 insertions(+), 239 deletions(-)<br>
><br>
> diff --git a/<a href="http://configure.ac" rel="noreferrer" target="_blank">configure.ac</a> b/<a href="http://configure.ac" rel="noreferrer" target="_blank">configure.ac</a><br>
> index a54b7cb..8ed606c 100644<br>
> --- a/<a href="http://configure.ac" rel="noreferrer" target="_blank">configure.ac</a><br>
> +++ b/<a href="http://configure.ac" rel="noreferrer" target="_blank">configure.ac</a><br>
> @@ -96,22 +96,22 @@ XDAMAGE_REQUIRED=1.1<br>
>  XSHMFENCE_REQUIRED=1.1<br>
>  XVMC_REQUIRED=1.0.6<br>
>  PYTHON_MAKO_REQUIRED=0.8.0<br>
>  LIBSENSORS_REQUIRED=4.0.0<br>
>  ZLIB_REQUIRED=1.2.3<br>
><br>
>  dnl LLVM versions<br>
>  LLVM_REQUIRED_GALLIUM=3.3.0<br>
>  LLVM_REQUIRED_OPENCL=3.9.0<br>
>  LLVM_REQUIRED_R600=3.9.0<br>
> -LLVM_REQUIRED_RADEONSI=3.9.0<br>
> -LLVM_REQUIRED_RADV=3.9.0<br>
> +LLVM_REQUIRED_RADEONSI=4.0.0<br>
> +LLVM_REQUIRED_RADV=4.0.0<br>
>  LLVM_REQUIRED_SWR=3.9.0<br>
><br>
>  dnl Check for progs<br>
>  AC_PROG_CPP<br>
>  AC_PROG_CC<br>
>  AC_PROG_CXX<br>
>  dnl add this here, so the help for this environmnet variable is close to<br>
>  dnl other CC/CXX flags related help<br>
>  AC_ARG_VAR([CXX11_CXXFLAGS], [Compiler flag to enable C++11 support (only needed if not<br>
>  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  enabled by default and different  from -std=c++11)])<br>
> diff --git a/src/amd/common/ac_llvm_<wbr>build.c b/src/amd/common/ac_llvm_<wbr>build.c<br>
> index 6ede60a..3efcaa1 100644<br>
> --- a/src/amd/common/ac_llvm_<wbr>build.c<br>
> +++ b/src/amd/common/ac_llvm_<wbr>build.c<br>
> @@ -213,22 +213,21 @@ ac_to_float(struct ac_llvm_context *ctx, LLVMValueRef v)<br>
>  Â  Â  Â  Â return LLVMBuildBitCast(ctx->builder, v, ac_to_float_type(ctx, type), "");<br>
>  }<br>
><br>
><br>
>  LLVMValueRef<br>
>  ac_build_intrinsic(struct ac_llvm_context *ctx, const char *name,<br>
>  Â  Â  Â  Â  Â  Â  Â  Â  Â  LLVMTypeRef return_type, LLVMValueRef *params,<br>
>  Â  Â  Â  Â  Â  Â  Â  Â  Â  unsigned param_count, unsigned attrib_mask)<br>
>  {<br>
>  Â  Â  Â  Â LLVMValueRef function, call;<br>
> -  Â  Â  Â bool set_callsite_attrs = HAVE_LLVM >= 0x0400 &&<br>
> -  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â !(attrib_mask & AC_FUNC_ATTR_LEGACY);<br>
> +  Â  Â  Â bool set_callsite_attrs = !(attrib_mask & AC_FUNC_ATTR_LEGACY);<br>
><br>
>  Â  Â  Â  Â function = LLVMGetNamedFunction(ctx-><wbr>module, name);<br>
>  Â  Â  Â  Â if (!function) {<br>
>  Â  Â  Â  Â  Â  Â  Â  Â LLVMTypeRef param_types[32], function_type;<br>
>  Â  Â  Â  Â  Â  Â  Â  Â unsigned i;<br>
><br>
>  Â  Â  Â  Â  Â  Â  Â  Â assert(param_count <= 32);<br>
><br>
>  Â  Â  Â  Â  Â  Â  Â  Â for (i = 0; i < param_count; ++i) {<br>
>  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â assert(params[i]);<br>
> @@ -714,34 +713,20 @@ ac_prepare_cube_coords(struct ac_llvm_context *ctx,<br>
>  LLVMValueRef<br>
>  ac_build_fs_interp(struct ac_llvm_context *ctx,<br>
>  Â  Â  Â  Â  Â  Â  Â  Â  Â  LLVMValueRef llvm_chan,<br>
>  Â  Â  Â  Â  Â  Â  Â  Â  Â  LLVMValueRef attr_number,<br>
>  Â  Â  Â  Â  Â  Â  Â  Â  Â  LLVMValueRef params,<br>
>  Â  Â  Â  Â  Â  Â  Â  Â  Â  LLVMValueRef i,<br>
>  Â  Â  Â  Â  Â  Â  Â  Â  Â  LLVMValueRef j)<br>
>  {<br>
>  Â  Â  Â  Â LLVMValueRef args[5];<br>
>  Â  Â  Â  Â LLVMValueRef p1;<br>
> -<br>
> -  Â  Â  Â if (HAVE_LLVM < 0x0400) {<br>
> -  Â  Â  Â  Â  Â  Â  Â LLVMValueRef ij[2];<br>
> -  Â  Â  Â  Â  Â  Â  Â ij[0] = LLVMBuildBitCast(ctx->builder, i, ctx->i32, "");<br>
> -  Â  Â  Â  Â  Â  Â  Â ij[1] = LLVMBuildBitCast(ctx->builder, j, ctx->i32, "");<br>
> -<br>
> -  Â  Â  Â  Â  Â  Â  Â args[0] = llvm_chan;<br>
> -  Â  Â  Â  Â  Â  Â  Â args[1] = attr_number;<br>
> -  Â  Â  Â  Â  Â  Â  Â args[2] = params;<br>
> -  Â  Â  Â  Â  Â  Â  Â args[3] = ac_build_gather_values(ctx, ij, 2);<br>
> -  Â  Â  Â  Â  Â  Â  Â return ac_build_intrinsic(ctx, "llvm.SI.fs.interp",<br>
> -  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â ctx->f32, args, 4,<br>
> -  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â AC_FUNC_ATTR_READNONE);<br>
> -  Â  Â  Â }<br>
><br>
>  Â  Â  Â  Â args[0] = i;<br>
>  Â  Â  Â  Â args[1] = llvm_chan;<br>
>  Â  Â  Â  Â args[2] = attr_number;<br>
>  Â  Â  Â  Â args[3] = params;<br>
><br>
>  Â  Â  Â  Â p1 = ac_build_intrinsic(ctx, "llvm.amdgcn.interp.p1",<br>
>  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â ctx->f32, args, 4, AC_FUNC_ATTR_READNONE);<br>
><br>
>  Â  Â  Â  Â args[0] = p1;<br>
> @@ -755,30 +740,20 @@ ac_build_fs_interp(struct ac_llvm_context *ctx,<br>
>  }<br>
><br>
>  LLVMValueRef<br>
>  ac_build_fs_interp_mov(struct ac_llvm_context *ctx,<br>
>  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  LLVMValueRef parameter,<br>
>  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  LLVMValueRef llvm_chan,<br>
>  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  LLVMValueRef attr_number,<br>
>  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  LLVMValueRef params)<br>
>  {<br>
>  Â  Â  Â  Â LLVMValueRef args[4];<br>
> -  Â  Â  Â if (HAVE_LLVM < 0x0400) {<br>
> -  Â  Â  Â  Â  Â  Â  Â args[0] = llvm_chan;<br>
> -  Â  Â  Â  Â  Â  Â  Â args[1] = attr_number;<br>
> -  Â  Â  Â  Â  Â  Â  Â args[2] = params;<br>
> -<br>
> -  Â  Â  Â  Â  Â  Â  Â return ac_build_intrinsic(ctx,<br>
> -  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â "llvm.SI.fs.constant",<br>
> -  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â ctx->f32, args, 3,<br>
> -  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â AC_FUNC_ATTR_READNONE);<br>
> -  Â  Â  Â }<br>
><br>
>  Â  Â  Â  Â args[0] = parameter;<br>
>  Â  Â  Â  Â args[1] = llvm_chan;<br>
>  Â  Â  Â  Â args[2] = attr_number;<br>
>  Â  Â  Â  Â args[3] = params;<br>
><br>
>  Â  Â  Â  Â return ac_build_intrinsic(ctx, "llvm.amdgcn.interp.mov",<br>
>  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â ctx->f32, args, 4, AC_FUNC_ATTR_READNONE);<br>
>  }<br>
><br>
> @@ -1202,34 +1177,31 @@ ac_build_ddxy(struct ac_llvm_context *ctx,<br>
>  Â  Â  Â  Â result = LLVMBuildFSub(ctx->builder, trbl, tl, "");<br>
>  Â  Â  Â  Â return result;<br>
>  }<br>
><br>
>  void<br>
>  ac_build_sendmsg(struct ac_llvm_context *ctx,<br>
>  Â  Â  Â  Â  Â  Â  Â  Â  uint32_t msg,<br>
>  Â  Â  Â  Â  Â  Â  Â  Â  LLVMValueRef wave_id)<br>
>  {<br>
>  Â  Â  Â  Â LLVMValueRef args[2];<br>
> -  Â  Â  Â const char *intr_name = (HAVE_LLVM < 0x0400) ? "llvm.SI.sendmsg" : "llvm.amdgcn.s.sendmsg";<br>
>  Â  Â  Â  Â args[0] = LLVMConstInt(ctx->i32, msg, false);<br>
>  Â  Â  Â  Â args[1] = wave_id;<br>
> -  Â  Â  Â ac_build_intrinsic(ctx, intr_name, ctx->voidt, args, 2, 0);<br>
> +  Â  Â  Â ac_build_intrinsic(ctx, "llvm.amdgcn.s.sendmsg", ctx->voidt, args, 2, 0);<br>
>  }<br>
><br>
>  LLVMValueRef<br>
>  ac_build_imsb(struct ac_llvm_context *ctx,<br>
>  Â  Â  Â  Â  Â  Â  Â LLVMValueRef arg,<br>
>  Â  Â  Â  Â  Â  Â  Â LLVMTypeRef dst_type)<br>
>  {<br>
> -  Â  Â  Â const char *intr_name = (HAVE_LLVM < 0x0400) ? "llvm.AMDGPU.flbit.i32" :<br>
> -  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  "llvm.amdgcn.sffbh.i32";<br>
> -  Â  Â  Â LLVMValueRef msb = ac_build_intrinsic(ctx, intr_name,<br>
> +  Â  Â  Â LLVMValueRef msb = ac_build_intrinsic(ctx, "llvm.amdgcn.sffbh.i32",<br>
>  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â dst_type, &arg, 1,<br>
>  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â AC_FUNC_ATTR_READNONE);<br>
><br>
>  Â  Â  Â  Â /* The HW returns the last bit index from MSB, but NIR/TGSI wants<br>
>  Â  Â  Â  Â  * the index from LSB. Invert it by doing "31 - msb". */<br>
>  Â  Â  Â  Â msb = LLVMBuildSub(ctx->builder, LLVMConstInt(ctx->i32, 31, false),<br>
>  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  msb, "");<br>
><br>
>  Â  Â  Â  Â LLVMValueRef all_ones = LLVMConstInt(ctx->i32, -1, true);<br>
>  Â  Â  Â  Â LLVMValueRef cond = LLVMBuildOr(ctx->builder,<br>
> @@ -1363,151 +1335,90 @@ void ac_build_export(struct ac_llvm_context *ctx, struct ac_export_args *a)<br>
>  Â  Â  Â  Â args[4] = LLVMConstInt(ctx->i32, a->compr, 0);<br>
>  Â  Â  Â  Â memcpy(args + 5, a->out, sizeof(a->out[0]) * 4);<br>
><br>
>  Â  Â  Â  Â ac_build_intrinsic(ctx, "llvm.SI.export", ctx->voidt, args, 9,<br>
>  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  AC_FUNC_ATTR_LEGACY);<br>
>  }<br>
><br>
>  LLVMValueRef ac_build_image_opcode(struct ac_llvm_context *ctx,<br>
>  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  struct ac_image_args *a)<br>
>  {<br>
> -  Â  Â  Â LLVMTypeRef dst_type;<br>
>  Â  Â  Â  Â LLVMValueRef args[11];<br>
>  Â  Â  Â  Â unsigned num_args = 0;<br>
>  Â  Â  Â  Â const char *name = NULL;<br>
>  Â  Â  Â  Â char intr_name[128], type[64];<br>
><br>
> -  Â  Â  Â if (HAVE_LLVM >= 0x0400) {<br>
> -  Â  Â  Â  Â  Â  Â  Â bool sample = a->opcode == ac_image_sample ||<br>
> -  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â a->opcode == ac_image_gather4 ||<br>
> -  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â a->opcode == ac_image_get_lod;<br>
> -<br>
> -  Â  Â  Â  Â  Â  Â  Â if (sample)<br>
> -  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â args[num_args++] = ac_to_float(ctx, a->addr);<br>
> -  Â  Â  Â  Â  Â  Â  Â else<br>
> -  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â args[num_args++] = a->addr;<br>
> -<br>
> -  Â  Â  Â  Â  Â  Â  Â args[num_args++] = a->resource;<br>
> -  Â  Â  Â  Â  Â  Â  Â if (sample)<br>
> -  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â args[num_args++] = a->sampler;<br>
> -  Â  Â  Â  Â  Â  Â  Â args[num_args++] = LLVMConstInt(ctx->i32, a->dmask, 0);<br>
> -  Â  Â  Â  Â  Â  Â  Â if (sample)<br>
> -  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â args[num_args++] = LLVMConstInt(ctx->i1, a->unorm, 0);<br>
> -  Â  Â  Â  Â  Â  Â  Â args[num_args++] = ctx->i1false; /* glc */<br>
> -  Â  Â  Â  Â  Â  Â  Â args[num_args++] = ctx->i1false; /* slc */<br>
> -  Â  Â  Â  Â  Â  Â  Â args[num_args++] = ctx->i1false; /* lwe */<br>
> -  Â  Â  Â  Â  Â  Â  Â args[num_args++] = LLVMConstInt(ctx->i1, a->da, 0);<br>
> -<br>
> -  Â  Â  Â  Â  Â  Â  Â switch (a->opcode) {<br>
> -  Â  Â  Â  Â  Â  Â  Â case ac_image_sample:<br>
> -  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â name = "llvm.amdgcn.image.sample";<br>
> -  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â break;<br>
> -  Â  Â  Â  Â  Â  Â  Â case ac_image_gather4:<br>
> -  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â name = "llvm.amdgcn.image.gather4";<br>
> -  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â break;<br>
> -  Â  Â  Â  Â  Â  Â  Â case ac_image_load:<br>
> -  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â name = "llvm.amdgcn.image.load";<br>
> -  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â break;<br>
> -  Â  Â  Â  Â  Â  Â  Â case ac_image_load_mip:<br>
> -  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â name = "llvm.amdgcn.image.load.mip";<br>
> -  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â break;<br>
> -  Â  Â  Â  Â  Â  Â  Â case ac_image_get_lod:<br>
> -  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â name = "llvm.amdgcn.image.getlod";<br>
> -  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â break;<br>
> -  Â  Â  Â  Â  Â  Â  Â case ac_image_get_resinfo:<br>
> -  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â name = "llvm.amdgcn.image.getresinfo"<wbr>;<br>
> -  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â break;<br>
> -  Â  Â  Â  Â  Â  Â  Â default:<br>
> -  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â unreachable("invalid image opcode");<br>
> -  Â  Â  Â  Â  Â  Â  Â }<br>
> +  Â  Â  Â bool sample = a->opcode == ac_image_sample ||<br>
> +  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â a->opcode == ac_image_gather4 ||<br>
> +  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â a->opcode == ac_image_get_lod;<br>
><br>
> -  Â  Â  Â  Â  Â  Â  Â ac_build_type_name_for_intr(<wbr>LLVMTypeOf(args[0]), type,<br>
> -  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â sizeof(type));<br>
> -<br>
> -  Â  Â  Â  Â  Â  Â  Â snprintf(intr_name, sizeof(intr_name), "%s%s%s%s.v4f32.%s.v8i32",<br>
> -  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â name,<br>
> -  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â a->compare ? ".c" : "",<br>
> -  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â a->bias ? ".b" :<br>
> -  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â a->lod ? ".l" :<br>
> -  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â a->deriv ? ".d" :<br>
> -  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â a->level_zero ? ".lz" : "",<br>
> -  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â a->offset ? ".o" : "",<br>
> -  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â type);<br>
> -<br>
> -  Â  Â  Â  Â  Â  Â  Â LLVMValueRef result =<br>
> -  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â ac_build_intrinsic(ctx, intr_name,<br>
> -  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  ctx->v4f32, args, num_args,<br>
> -  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  AC_FUNC_ATTR_READNONE);<br>
> -  Â  Â  Â  Â  Â  Â  Â if (!sample) {<br>
> -  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â result = LLVMBuildBitCast(ctx->builder, result,<br>
> -  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â ctx->v4i32, "");<br>
> -  Â  Â  Â  Â  Â  Â  Â }<br>
> -  Â  Â  Â  Â  Â  Â  Â return result;<br>
> -  Â  Â  Â }<br>
> +  Â  Â  Â if (sample)<br>
> +  Â  Â  Â  Â  Â  Â  Â args[num_args++] = ac_to_float(ctx, a->addr);<br>
> +  Â  Â  Â else<br>
> +  Â  Â  Â  Â  Â  Â  Â args[num_args++] = a->addr;<br>
><br>
> -  Â  Â  Â args[num_args++] = a->addr;<br>
>  Â  Â  Â  Â args[num_args++] = a->resource;<br>
> -<br>
> -  Â  Â  Â if (a->opcode == ac_image_load ||<br>
> -  Â  Â  Â  Â  Â a->opcode == ac_image_load_mip ||<br>
> -  Â  Â  Â  Â  Â a->opcode == ac_image_get_resinfo) {<br>
> -  Â  Â  Â  Â  Â  Â  Â dst_type = ctx->v4i32;<br>
> -  Â  Â  Â } else {<br>
> -  Â  Â  Â  Â  Â  Â  Â dst_type = ctx->v4f32;<br>
> +  Â  Â  Â if (sample)<br>
>  Â  Â  Â  Â  Â  Â  Â  Â args[num_args++] = a->sampler;<br>
> -  Â  Â  Â }<br>
> -<br>
>  Â  Â  Â  Â args[num_args++] = LLVMConstInt(ctx->i32, a->dmask, 0);<br>
> -  Â  Â  Â args[num_args++] = LLVMConstInt(ctx->i32, a->unorm, 0);<br>
> -  Â  Â  Â args[num_args++] = LLVMConstInt(ctx->i32, 0, 0); /* r128 */<br>
> -  Â  Â  Â args[num_args++] = LLVMConstInt(ctx->i32, a->da, 0);<br>
> -  Â  Â  Â args[num_args++] = LLVMConstInt(ctx->i32, 0, 0); /* glc */<br>
> -  Â  Â  Â args[num_args++] = LLVMConstInt(ctx->i32, 0, 0); /* slc */<br>
> -  Â  Â  Â args[num_args++] = LLVMConstInt(ctx->i32, 0, 0); /* tfe */<br>
> -  Â  Â  Â args[num_args++] = LLVMConstInt(ctx->i32, 0, 0); /* lwe */<br>
> +  Â  Â  Â if (sample)<br>
> +  Â  Â  Â  Â  Â  Â  Â args[num_args++] = LLVMConstInt(ctx->i1, a->unorm, 0);<br>
> +  Â  Â  Â args[num_args++] = ctx->i1false; /* glc */<br>
> +  Â  Â  Â args[num_args++] = ctx->i1false; /* slc */<br>
> +  Â  Â  Â args[num_args++] = ctx->i1false; /* lwe */<br>
> +  Â  Â  Â args[num_args++] = LLVMConstInt(ctx->i1, a->da, 0);<br>
><br>
>  Â  Â  Â  Â switch (a->opcode) {<br>
>  Â  Â  Â  Â case ac_image_sample:<br>
> -  Â  Â  Â  Â  Â  Â  Â name = "llvm.SI.image.sample";<br>
> +  Â  Â  Â  Â  Â  Â  Â name = "llvm.amdgcn.image.sample";<br>
>  Â  Â  Â  Â  Â  Â  Â  Â break;<br>
>  Â  Â  Â  Â case ac_image_gather4:<br>
> -  Â  Â  Â  Â  Â  Â  Â name = "llvm.SI.gather4";<br>
> +  Â  Â  Â  Â  Â  Â  Â name = "llvm.amdgcn.image.gather4";<br>
>  Â  Â  Â  Â  Â  Â  Â  Â break;<br>
>  Â  Â  Â  Â case ac_image_load:<br>
> -  Â  Â  Â  Â  Â  Â  Â name = "llvm.SI.image.load";<br>
> +  Â  Â  Â  Â  Â  Â  Â name = "llvm.amdgcn.image.load";<br>
>  Â  Â  Â  Â  Â  Â  Â  Â break;<br>
>  Â  Â  Â  Â case ac_image_load_mip:<br>
> -  Â  Â  Â  Â  Â  Â  Â name = "llvm.SI.image.load.mip";<br>
> +  Â  Â  Â  Â  Â  Â  Â name = "llvm.amdgcn.image.load.mip";<br>
>  Â  Â  Â  Â  Â  Â  Â  Â break;<br>
>  Â  Â  Â  Â case ac_image_get_lod:<br>
> -  Â  Â  Â  Â  Â  Â  Â name = "llvm.SI.getlod";<br>
> +  Â  Â  Â  Â  Â  Â  Â name = "llvm.amdgcn.image.getlod";<br>
>  Â  Â  Â  Â  Â  Â  Â  Â break;<br>
>  Â  Â  Â  Â case ac_image_get_resinfo:<br>
> -  Â  Â  Â  Â  Â  Â  Â name = "llvm.SI.getresinfo";<br>
> +  Â  Â  Â  Â  Â  Â  Â name = "llvm.amdgcn.image.getresinfo"<wbr>;<br>
>  Â  Â  Â  Â  Â  Â  Â  Â break;<br>
> +  Â  Â  Â default:<br>
> +  Â  Â  Â  Â  Â  Â  Â unreachable("invalid image opcode");<br>
>  Â  Â  Â  Â }<br>
><br>
> -  Â  Â  Â ac_build_type_name_for_intr(<wbr>LLVMTypeOf(a->addr), type, sizeof(type));<br>
> -  Â  Â  Â snprintf(intr_name, sizeof(intr_name), "%s%s%s%s.%s",<br>
> +  Â  Â  Â ac_build_type_name_for_intr(<wbr>LLVMTypeOf(args[0]), type,<br>
> +  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â sizeof(type));<br>
> +<br>
> +  Â  Â  Â snprintf(intr_name, sizeof(intr_name), "%s%s%s%s.v4f32.%s.v8i32",<br>
>  Â  Â  Â  Â  Â  Â  Â  Â name,<br>
>  Â  Â  Â  Â  Â  Â  Â  Â a->compare ? ".c" : "",<br>
>  Â  Â  Â  Â  Â  Â  Â  Â a->bias ? ".b" :<br>
>  Â  Â  Â  Â  Â  Â  Â  Â a->lod ? ".l" :<br>
>  Â  Â  Â  Â  Â  Â  Â  Â a->deriv ? ".d" :<br>
>  Â  Â  Â  Â  Â  Â  Â  Â a->level_zero ? ".lz" : "",<br>
>  Â  Â  Â  Â  Â  Â  Â  Â a->offset ? ".o" : "",<br>
>  Â  Â  Â  Â  Â  Â  Â  Â type);<br>
><br>
> -  Â  Â  Â return ac_build_intrinsic(ctx, intr_name,<br>
> -  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â dst_type, args, num_args,<br>
> -  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â AC_FUNC_ATTR_READNONE |<br>
> -  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â AC_FUNC_ATTR_LEGACY);<br>
> +  Â  Â  Â LLVMValueRef result =<br>
> +  Â  Â  Â  Â  Â  Â  Â ac_build_intrinsic(ctx, intr_name,<br>
> +  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  ctx->v4f32, args, num_args,<br>
> +  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  AC_FUNC_ATTR_READNONE);<br>
> +  Â  Â  Â if (!sample) {<br>
> +  Â  Â  Â  Â  Â  Â  Â result = LLVMBuildBitCast(ctx->builder, result,<br>
> +  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â ctx->v4i32, "");<br>
> +  Â  Â  Â }<br>
> +  Â  Â  Â return result;<br>
>  }<br>
><br>
>  LLVMValueRef ac_build_cvt_pkrtz_f16(struct ac_llvm_context *ctx,<br>
>  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â LLVMValueRef args[2])<br>
>  {<br>
>  Â  Â  Â  Â if (HAVE_LLVM >= 0x0500) {<br>
>  Â  Â  Â  Â  Â  Â  Â  Â LLVMTypeRef v2f16 =<br>
>  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â LLVMVectorType(<wbr>LLVMHalfTypeInContext(ctx-><wbr>context), 2);<br>
>  Â  Â  Â  Â  Â  Â  Â  Â LLVMValueRef res =<br>
>  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â ac_build_intrinsic(ctx, "llvm.amdgcn.cvt.pkrtz",<br>
> @@ -1731,33 +1642,29 @@ void ac_get_image_intr_name(const char *base_name,<br>
>  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â LLVMTypeRef data_type,<br>
>  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â LLVMTypeRef coords_type,<br>
>  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â LLVMTypeRef rsrc_type,<br>
>  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â char *out_name, unsigned out_len)<br>
>  {<br>
>  Â  Â  Â  Â  char coords_type_name[8];<br>
><br>
>  Â  Â  Â  Â  ac_build_type_name_for_intr(<wbr>coords_type, coords_type_name,<br>
>  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  sizeof(coords_type_name));<br>
><br>
> -  Â  Â  Â  if (HAVE_LLVM <= 0x0309) {<br>
> -  Â  Â  Â  Â  Â  Â  Â  snprintf(out_name, out_len, "%s.%s", base_name, coords_type_name);<br>
> -  Â  Â  Â  } else {<br>
> -  Â  Â  Â  Â  Â  Â  Â  char data_type_name[8];<br>
> -  Â  Â  Â  Â  Â  Â  Â  char rsrc_type_name[8];<br>
> -<br>
> -  Â  Â  Â  Â  Â  Â  Â  ac_build_type_name_for_intr(<wbr>data_type, data_type_name,<br>
> -  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  sizeof(data_type_name));<br>
> -  Â  Â  Â  Â  Â  Â  Â  ac_build_type_name_for_intr(<wbr>rsrc_type, rsrc_type_name,<br>
> -  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  sizeof(rsrc_type_name));<br>
> -  Â  Â  Â  Â  Â  Â  Â  snprintf(out_name, out_len, "%s.%s.%s.%s", base_name,<br>
> -  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â data_type_name, coords_type_name, rsrc_type_name);<br>
> -  Â  Â  Â  }<br>
> +  Â  Â  Â char data_type_name[8];<br>
> +  Â  Â  Â char rsrc_type_name[8];<br>
> +<br>
> +  Â  Â  Â ac_build_type_name_for_intr(<wbr>data_type, data_type_name,<br>
> +  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â sizeof(data_type_name));<br>
> +  Â  Â  Â ac_build_type_name_for_intr(<wbr>rsrc_type, rsrc_type_name,<br>
> +  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â sizeof(rsrc_type_name));<br>
> +  Â  Â  Â snprintf(out_name, out_len, "%s.%s.%s.%s", base_name,<br>
> +  Â  Â  Â  Â  Â  Â  Â  data_type_name, coords_type_name, rsrc_type_name);<br>
>  }<br>
><br>
>  #define AC_EXP_TARGET (HAVE_LLVM >= 0x0500 ? 0 : 3)<br>
>  #define AC_EXP_OUT0 (HAVE_LLVM >= 0x0500 ? 2 : 5)<br>
><br>
>  enum ac_ir_type {<br>
>  Â  Â  Â  Â AC_IR_UNDEF,<br>
>  Â  Â  Â  Â AC_IR_CONST,<br>
>  Â  Â  Â  Â AC_IR_VALUE,<br>
>  };<br>
> diff --git a/src/amd/common/ac_llvm_<wbr>helper.cpp b/src/amd/common/ac_llvm_<wbr>helper.cpp<br>
> index 793737c..1d2369b 100644<br>
> --- a/src/amd/common/ac_llvm_<wbr>helper.cpp<br>
> +++ b/src/amd/common/ac_llvm_<wbr>helper.cpp<br>
> @@ -58,54 +58,44 @@ void ac_add_attr_dereferenceable(<wbr>LLVMValueRef val, uint64_t bytes)<br>
>  bool ac_is_sgpr_param(LLVMValueRef arg)<br>
>  {<br>
>  Â  Â  Â  Â llvm::Argument *A = llvm::unwrap<llvm::Argument>(<wbr>arg);<br>
>  Â  Â  Â  Â llvm::AttributeList AS = A->getParent()->getAttributes(<wbr>);<br>
>  Â  Â  Â  Â unsigned ArgNo = A->getArgNo();<br>
>  Â  Â  Â  Â return AS.hasAttribute(ArgNo + 1, llvm::Attribute::InReg);<br>
>  }<br>
><br>
>  LLVMValueRef ac_llvm_get_called_value(<wbr>LLVMValueRef call)<br>
>  {<br>
> -#if HAVE_LLVM >= 0x0309<br>
>  Â  Â  Â  Â return LLVMGetCalledValue(call);<br>
> -#else<br>
> -  Â  Â  Â return llvm::wrap(llvm::CallSite(<wbr>llvm::unwrap<llvm::<wbr>Instruction>(call)).<wbr>getCalledValue());<br>
> -#endif<br>
>  }<br>
><br>
>  bool ac_llvm_is_function(<wbr>LLVMValueRef v)<br>
>  {<br>
> -#if HAVE_LLVM >= 0x0309<br>
>  Â  Â  Â  Â return LLVMGetValueKind(v) == LLVMFunctionValueKind;<br>
> -#else<br>
> -  Â  Â  Â return llvm::isa<llvm::Function>(<wbr>llvm::unwrap(v));<br>
> -#endif<br>
>  }<br>
><br>
>  LLVMBuilderRef ac_create_builder(<wbr>LLVMContextRef ctx,<br>
>  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  enum ac_float_mode float_mode)<br>
>  {<br>
>  Â  Â  Â  Â LLVMBuilderRef builder = LLVMCreateBuilderInContext(<wbr>ctx);<br>
><br>
> -#if HAVE_LLVM >= 0x0308<br>
>  Â  Â  Â  Â llvm::FastMathFlags flags;<br>
><br>
>  Â  Â  Â  Â switch (float_mode) {<br>
>  Â  Â  Â  Â case AC_FLOAT_MODE_DEFAULT:<br>
>  Â  Â  Â  Â  Â  Â  Â  Â break;<br>
>  Â  Â  Â  Â case AC_FLOAT_MODE_NO_SIGNED_ZEROS_<wbr>FP_MATH:<br>
>  Â  Â  Â  Â  Â  Â  Â  Â flags.setNoSignedZeros();<br>
>  Â  Â  Â  Â  Â  Â  Â  Â llvm::unwrap(builder)-><wbr>setFastMathFlags(flags);<br>
>  Â  Â  Â  Â  Â  Â  Â  Â break;<br>
>  Â  Â  Â  Â case AC_FLOAT_MODE_UNSAFE_FP_MATH:<br>
>  #if HAVE_LLVM >= 0x0600<br>
>  Â  Â  Â  Â  Â  Â  Â  Â flags.setFast();<br>
>  #else<br>
>  Â  Â  Â  Â  Â  Â  Â  Â flags.setUnsafeAlgebra();<br>
>  #endif<br>
>  Â  Â  Â  Â  Â  Â  Â  Â llvm::unwrap(builder)-><wbr>setFastMathFlags(flags);<br>
>  Â  Â  Â  Â  Â  Â  Â  Â break;<br>
>  Â  Â  Â  Â }<br>
> -#endif<br>
><br>
>  Â  Â  Â  Â return builder;<br>
>  }<br>
> diff --git a/src/amd/common/ac_llvm_util.<wbr>c b/src/amd/common/ac_llvm_util.<wbr>c<br>
> index 5fd785a..b88c4e4 100644<br>
> --- a/src/amd/common/ac_llvm_util.<wbr>c<br>
> +++ b/src/amd/common/ac_llvm_util.<wbr>c<br>
> @@ -39,26 +39,25 @@ static void ac_init_llvm_target()<br>
>  Â  Â  Â  Â LLVMInitializeAMDGPUTarget();<br>
>  Â  Â  Â  Â LLVMInitializeAMDGPUTargetMC()<wbr>;<br>
>  Â  Â  Â  Â LLVMInitializeAMDGPUAsmPrinter<wbr>();<br>
><br>
>  Â  Â  Â  Â /* For inline assembly. */<br>
>  Â  Â  Â  Â LLVMInitializeAMDGPUAsmParser(<wbr>);<br>
><br>
>  Â  Â  Â  Â /* Workaround for bug in llvm 4.0 that causes image intrinsics<br>
>  Â  Â  Â  Â  * to disappear.<br>
>  Â  Â  Â  Â  * <a href="https://reviews.llvm.org/D26348" rel="noreferrer" target="_blank">https://reviews.llvm.org/<wbr>D26348</a><br>
> +  Â  Â  Â  *<br>
> +  Â  Â  Â  * "mesa" is the prefix for error messages.<br>
>  Â  Â  Â  Â  */<br>
> -  Â  Â  Â if (HAVE_LLVM >= 0x0400) {<br>
> -  Â  Â  Â  Â  Â  Â  Â /* "mesa" is the prefix for error messages */<br>
> -  Â  Â  Â  Â  Â  Â  Â const char *argv[2] = { "mesa", "-simplifycfg-sink-common=<wbr>false" };<br>
> -  Â  Â  Â  Â  Â  Â  Â LLVMParseCommandLineOptions(2, argv, NULL);<br>
> -  Â  Â  Â }<br>
> +  Â  Â  Â const char *argv[2] = { "mesa", "-simplifycfg-sink-common=<wbr>false" };<br>
> +  Â  Â  Â LLVMParseCommandLineOptions(2, argv, NULL);<br>
>  }<br>
><br>
>  static once_flag ac_init_llvm_target_once_flag = ONCE_FLAG_INIT;<br>
><br>
>  LLVMTargetRef ac_get_llvm_target(const char *triple)<br>
>  {<br>
>  Â  Â  Â  Â LLVMTargetRef target = NULL;<br>
>  Â  Â  Â  Â char *err_message = NULL;<br>
><br>
>  Â  Â  Â  Â call_once(&ac_init_llvm_<wbr>target_once_flag, ac_init_llvm_target);<br>
> @@ -139,81 +138,51 @@ LLVMTargetMachineRef ac_create_target_machine(enum radeon_family family, enum ac<br>
>  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  triple,<br>
>  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  ac_get_llvm_processor_name(<wbr>family),<br>
>  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  features,<br>
>  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  LLVMCodeGenLevelDefault,<br>
>  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  LLVMRelocDefault,<br>
>  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  LLVMCodeModelDefault);<br>
><br>
>  Â  Â  Â  Â return tm;<br>
>  }<br>
><br>
> -<br>
> -#if HAVE_LLVM < 0x0400<br>
> -static LLVMAttribute ac_attr_to_llvm_attr(enum ac_func_attr attr)<br>
> -{<br>
> -  Â switch (attr) {<br>
> -  Â case AC_FUNC_ATTR_ALWAYSINLINE: return LLVMAlwaysInlineAttribute;<br>
> -  Â case AC_FUNC_ATTR_INREG: return LLVMInRegAttribute;<br>
> -  Â case AC_FUNC_ATTR_NOALIAS: return LLVMNoAliasAttribute;<br>
> -  Â case AC_FUNC_ATTR_NOUNWIND: return LLVMNoUnwindAttribute;<br>
> -  Â case AC_FUNC_ATTR_READNONE: return LLVMReadNoneAttribute;<br>
> -  Â case AC_FUNC_ATTR_READONLY: return LLVMReadOnlyAttribute;<br>
> -  Â default:<br>
> -  Â  Â  Â  Â  fprintf(stderr, "Unhandled function attribute: %x\n", attr);<br>
> -  Â  Â  Â  Â  return 0;<br>
> -  Â }<br>
> -}<br>
> -<br>
> -#else<br>
> -<br>
>  static const char *attr_to_str(enum ac_func_attr attr)<br>
>  {<br>
>  Â  Â switch (attr) {<br>
>  Â  Â case AC_FUNC_ATTR_ALWAYSINLINE: return "alwaysinline";<br>
>  Â  Â case AC_FUNC_ATTR_INREG: return "inreg";<br>
>  Â  Â case AC_FUNC_ATTR_NOALIAS: return "noalias";<br>
>  Â  Â case AC_FUNC_ATTR_NOUNWIND: return "nounwind";<br>
>  Â  Â case AC_FUNC_ATTR_READNONE: return "readnone";<br>
>  Â  Â case AC_FUNC_ATTR_READONLY: return "readonly";<br>
>  Â  Â case AC_FUNC_ATTR_WRITEONLY: return "writeonly";<br>
>  Â  Â case AC_FUNC_ATTR_INACCESSIBLE_MEM_<wbr>ONLY: return "inaccessiblememonly";<br>
>  Â  Â case AC_FUNC_ATTR_CONVERGENT: return "convergent";<br>
>  Â  Â default:<br>
>  Â  Â  Â  Â  Â  fprintf(stderr, "Unhandled function attribute: %x\n", attr);<br>
>  Â  Â  Â  Â  Â  return 0;<br>
>  Â  Â }<br>
>  }<br>
><br>
> -#endif<br>
> -<br>
>  void<br>
>  ac_add_function_attr(<wbr>LLVMContextRef ctx, LLVMValueRef function,<br>
>  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â int attr_idx, enum ac_func_attr attr)<br>
>  {<br>
> -#if HAVE_LLVM < 0x0400<br>
> -  Â LLVMAttribute llvm_attr = ac_attr_to_llvm_attr(attr);<br>
> -  Â if (attr_idx == -1) {<br>
> -  Â  Â  LLVMAddFunctionAttr(function, llvm_attr);<br>
> -  Â } else {<br>
> -  Â  Â  LLVMAddAttribute(LLVMGetParam(<wbr>function, attr_idx - 1), llvm_attr);<br>
> -  Â }<br>
> -#else<br>
>  Â  Â const char *attr_name = attr_to_str(attr);<br>
>  Â  Â unsigned kind_id = LLVMGetEnumAttributeKindForNam<wbr>e(attr_name,<br>
>  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  strlen(attr_name));<br>
>  Â  Â LLVMAttributeRef llvm_attr = LLVMCreateEnumAttribute(ctx, kind_id, 0);<br>
><br>
>  Â  Â if (LLVMIsAFunction(function))<br>
>  Â  Â  Â  LLVMAddAttributeAtIndex(<wbr>function, attr_idx, llvm_attr);<br>
>  Â  Â else<br>
>  Â  Â  Â  LLVMAddCallSiteAttribute(<wbr>function, attr_idx, llvm_attr);<br>
> -#endif<br>
>  }<br>
><br>
>  void ac_add_func_attributes(<wbr>LLVMContextRef ctx, LLVMValueRef function,<br>
>  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â unsigned attrib_mask)<br>
>  {<br>
>  Â  Â  Â  Â attrib_mask |= AC_FUNC_ATTR_NOUNWIND;<br>
>  Â  Â  Â  Â attrib_mask &= ~AC_FUNC_ATTR_LEGACY;<br>
><br>
>  Â  Â  Â  Â while (attrib_mask) {<br>
>  Â  Â  Â  Â  Â  Â  Â  Â enum ac_func_attr attr = 1u << u_bit_scan(&attrib_mask);<br>
> diff --git a/src/amd/common/ac_llvm_util.<wbr>h b/src/amd/common/ac_llvm_util.<wbr>h<br>
> index 29dc0c1..3cf385a 100644<br>
> --- a/src/amd/common/ac_llvm_util.<wbr>h<br>
> +++ b/src/amd/common/ac_llvm_util.<wbr>h<br>
> @@ -35,23 +35,23 @@<br>
>  extern "C" {<br>
>  #endif<br>
><br>
>  enum ac_func_attr {<br>
>  Â  Â  Â  Â AC_FUNC_ATTR_ALWAYSINLINE = (1 << 0),<br>
>  Â  Â  Â  Â AC_FUNC_ATTR_INREG  Â  Â  Â  = (1 << 2),<br>
>  Â  Â  Â  Â AC_FUNC_ATTR_NOALIAS  Â  Â  = (1 << 3),<br>
>  Â  Â  Â  Â AC_FUNC_ATTR_NOUNWIND  Â  Â = (1 << 4),<br>
>  Â  Â  Â  Â AC_FUNC_ATTR_READNONE  Â  Â = (1 << 5),<br>
>  Â  Â  Â  Â AC_FUNC_ATTR_READONLY  Â  Â = (1 << 6),<br>
> -  Â  Â  Â AC_FUNC_ATTR_WRITEONLY  Â  = HAVE_LLVM >= 0x0400 ? (1 << 7) : 0,<br>
> -  Â  Â  Â AC_FUNC_ATTR_INACCESSIBLE_MEM_<wbr>ONLY = HAVE_LLVM >= 0x0400 ? (1 << 8) : 0,<br>
> -  Â  Â  Â AC_FUNC_ATTR_CONVERGENT = HAVE_LLVM >= 0x0400 ? (1 << 9) : 0,<br>
> +  Â  Â  Â AC_FUNC_ATTR_WRITEONLY  Â  = (1 << 7),<br>
> +  Â  Â  Â AC_FUNC_ATTR_INACCESSIBLE_MEM_<wbr>ONLY = (1 << 8),<br>
> +  Â  Â  Â AC_FUNC_ATTR_CONVERGENT = (1 << 9),<br>
><br>
>  Â  Â  Â  Â /* Legacy intrinsic that needs attributes on function declarations<br>
>  Â  Â  Â  Â  * and they must match the internal LLVM definition exactly, otherwise<br>
>  Â  Â  Â  Â  * intrinsic selection fails.<br>
>  Â  Â  Â  Â  */<br>
>  Â  Â  Â  Â AC_FUNC_ATTR_LEGACY  Â  Â  Â = (1u << 31),<br>
>  };<br>
><br>
>  enum ac_target_machine_options {<br>
>  Â  Â  Â  Â AC_TM_SUPPORTS_SPILL = (1 << 0),<br>
> @@ -87,28 +87,26 @@ LLVMBuilderRef ac_create_builder(<wbr>LLVMContextRef ctx,<br>
><br>
>  void<br>
>  ac_llvm_add_target_dep_<wbr>function_attr(LLVMValueRef F,<br>
>  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  const char *name, int value);<br>
><br>
>  static inline unsigned<br>
>  ac_get_load_intr_attribs(bool can_speculate)<br>
>  {<br>
>  Â  Â  Â  Â /* READNONE means writes can't affect it, while READONLY means that<br>
>  Â  Â  Â  Â  * writes can affect it. */<br>
> -  Â  Â  Â return can_speculate && HAVE_LLVM >= 0x0400 ?<br>
> -  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  AC_FUNC_ATTR_READNONE :<br>
> -  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  AC_FUNC_ATTR_READONLY;<br>
> +  Â  Â  Â return can_speculate ? AC_FUNC_ATTR_READNONE :<br>
> +  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  AC_FUNC_ATTR_READONLY;<br>
>  }<br>
><br>
>  static inline unsigned<br>
>  ac_get_store_intr_attribs(bool writeonly_memory)<br>
>  {<br>
> -  Â  Â  Â return writeonly_memory && HAVE_LLVM >= 0x0400 ?<br>
> -  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â AC_FUNC_ATTR_INACCESSIBLE_MEM_<wbr>ONLY :<br>
> +  Â  Â  Â return writeonly_memory ? AC_FUNC_ATTR_INACCESSIBLE_MEM_<wbr>ONLY :<br>
>  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â AC_FUNC_ATTR_WRITEONLY;<br>
>  }<br>
><br>
>  #ifdef __cplusplus<br>
>  }<br>
>  #endif<br>
><br>
>  #endif /* AC_LLVM_UTIL_H */<br>
> diff --git a/src/amd/common/ac_nir_to_<wbr>llvm.c b/src/amd/common/ac_nir_to_<wbr>llvm.c<br>
> index 0f7d625..cfcd217 100644<br>
> --- a/src/amd/common/ac_nir_to_<wbr>llvm.c<br>
> +++ b/src/amd/common/ac_nir_to_<wbr>llvm.c<br>
> @@ -3628,32 +3628,24 @@ static LLVMValueRef visit_image_load(struct ac_nir_context *ctx,<br>
>  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  dim == GLSL_SAMPLER_DIM_3D ||<br>
>  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  dim == GLSL_SAMPLER_DIM_SUBPASS ||<br>
>  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  dim == GLSL_SAMPLER_DIM_SUBPASS_MS;<br>
>  Â  Â  Â  Â  Â  Â  Â  Â LLVMValueRef da = is_da ? ctx->ac.i1true : ctx->ac.i1false;<br>
>  Â  Â  Â  Â  Â  Â  Â  Â LLVMValueRef glc = ctx->ac.i1false;<br>
>  Â  Â  Â  Â  Â  Â  Â  Â LLVMValueRef slc = ctx->ac.i1false;<br>
><br>
>  Â  Â  Â  Â  Â  Â  Â  Â params[0] = get_image_coords(ctx, instr);<br>
>  Â  Â  Â  Â  Â  Â  Â  Â params[1] = get_sampler_desc(ctx, instr->variables[0], AC_DESC_IMAGE, NULL, true, false);<br>
>  Â  Â  Â  Â  Â  Â  Â  Â params[2] = LLVMConstInt(ctx->ac.i32, 15, false); /* dmask */<br>
> -  Â  Â  Â  Â  Â  Â  Â if (HAVE_LLVM <= 0x0309) {<br>
> -  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â params[3] = ctx->ac.i1false;  /* r128 */<br>
> -  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â params[4] = da;<br>
> -  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â params[5] = glc;<br>
> -  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â params[6] = slc;<br>
> -  Â  Â  Â  Â  Â  Â  Â } else {<br>
> -  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â LLVMValueRef lwe = ctx->ac.i1false;<br>
> -  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â params[3] = glc;<br>
> -  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â params[4] = slc;<br>
> -  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â params[5] = lwe;<br>
> -  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â params[6] = da;<br>
> -  Â  Â  Â  Â  Â  Â  Â }<br>
> +  Â  Â  Â  Â  Â  Â  Â params[3] = glc;<br>
> +  Â  Â  Â  Â  Â  Â  Â params[4] = slc;<br>
> +  Â  Â  Â  Â  Â  Â  Â params[5] = ctx->ac.i1false;<br>
> +  Â  Â  Â  Â  Â  Â  Â params[6] = da;<br>
><br>
>  Â  Â  Â  Â  Â  Â  Â  Â ac_get_image_intr_name("llvm.<wbr>amdgcn.image.load",<br>
>  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  ctx->ac.v4f32, /* vdata */<br>
>  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  LLVMTypeOf(params[0]), /* coords */<br>
>  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  LLVMTypeOf(params[1]), /* rsrc */<br>
>  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  intrinsic_name, sizeof(intrinsic_name));<br>
><br>
>  Â  Â  Â  Â  Â  Â  Â  Â res = ac_build_intrinsic(&ctx->ac, intrinsic_name, ctx->ac.v4f32,<br>
>  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  params, 7, AC_FUNC_ATTR_READONLY);<br>
>  Â  Â  Â  Â }<br>
> @@ -3687,32 +3679,24 @@ static void visit_image_store(struct ac_nir_context *ctx,<br>
>  Â  Â  Â  Â  Â  Â  Â  Â bool is_da = glsl_sampler_type_is_array(<wbr>type) ||<br>
>  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  dim == GLSL_SAMPLER_DIM_CUBE ||<br>
>  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  dim == GLSL_SAMPLER_DIM_3D;<br>
>  Â  Â  Â  Â  Â  Â  Â  Â LLVMValueRef da = is_da ? ctx->ac.i1true : ctx->ac.i1false;<br>
>  Â  Â  Â  Â  Â  Â  Â  Â LLVMValueRef slc = ctx->ac.i1false;<br>
><br>
>  Â  Â  Â  Â  Â  Â  Â  Â params[0] = ac_to_float(&ctx->ac, get_src(ctx, instr->src[2]));<br>
>  Â  Â  Â  Â  Â  Â  Â  Â params[1] = get_image_coords(ctx, instr); /* coords */<br>
>  Â  Â  Â  Â  Â  Â  Â  Â params[2] = get_sampler_desc(ctx, instr->variables[0], AC_DESC_IMAGE, NULL, true, true);<br>
>  Â  Â  Â  Â  Â  Â  Â  Â params[3] = LLVMConstInt(ctx->ac.i32, 15, false); /* dmask */<br>
> -  Â  Â  Â  Â  Â  Â  Â if (HAVE_LLVM <= 0x0309) {<br>
> -  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â params[4] = ctx->ac.i1false;  /* r128 */<br>
> -  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â params[5] = da;<br>
> -  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â params[6] = glc;<br>
> -  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â params[7] = slc;<br>
> -  Â  Â  Â  Â  Â  Â  Â } else {<br>
> -  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â LLVMValueRef lwe = ctx->ac.i1false;<br>
> -  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â params[4] = glc;<br>
> -  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â params[5] = slc;<br>
> -  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â params[6] = lwe;<br>
> -  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â params[7] = da;<br>
> -  Â  Â  Â  Â  Â  Â  Â }<br>
> +  Â  Â  Â  Â  Â  Â  Â params[4] = glc;<br>
> +  Â  Â  Â  Â  Â  Â  Â params[5] = slc;<br>
> +  Â  Â  Â  Â  Â  Â  Â params[6] = ctx->ac.i1false;<br>
> +  Â  Â  Â  Â  Â  Â  Â params[7] = da;<br>
><br>
>  Â  Â  Â  Â  Â  Â  Â  Â ac_get_image_intr_name("llvm.<wbr>amdgcn.image.store",<br>
>  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  LLVMTypeOf(params[0]), /* vdata */<br>
>  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  LLVMTypeOf(params[1]), /* coords */<br>
>  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  LLVMTypeOf(params[2]), /* rsrc */<br>
>  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  intrinsic_name, sizeof(intrinsic_name));<br>
><br>
>  Â  Â  Â  Â  Â  Â  Â  Â ac_build_intrinsic(&ctx->ac, intrinsic_name, ctx->ac.voidt,<br>
>  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  params, 8, 0);<br>
>  Â  Â  Â  Â }<br>
> diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c<br>
> index aea723c..9fda419 100644<br>
> --- a/src/amd/vulkan/radv_device.c<br>
> +++ b/src/amd/vulkan/radv_device.c<br>
> @@ -1106,25 +1106,21 @@ VkResult radv_CreateDevice(<br>
>  Â  Â  Â  Â device->pbb_allowed = device->physical_device->rad_<wbr>info.chip_class >= GFX9 &&<br>
>  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â (device->instance->perftest_<wbr>flags & RADV_PERFTEST_BINNING);<br>
><br>
>  Â  Â  Â  Â /* Disabled and not implemented for now. */<br>
>  Â  Â  Â  Â device->dfsm_allowed = device->pbb_allowed && false;<br>
><br>
>  #ifdef ANDROID<br>
>  Â  Â  Â  Â device->always_use_syncobj = device->physical_device->rad_<wbr>info.has_syncobj_wait_for_<wbr>submit;<br>
>  #endif<br>
><br>
> -#if HAVE_LLVM < 0x0400<br>
> -  Â  Â  Â device->llvm_supports_spill = false;<br>
> -#else<br>
>  Â  Â  Â  Â device->llvm_supports_spill = true;<br>
> -#endif<br>
><br>
>  Â  Â  Â  Â /* The maximum number of scratch waves. Scratch space isn't divided<br>
>  Â  Â  Â  Â  * evenly between CUs. The number is only a function of the number of CUs.<br>
>  Â  Â  Â  Â  * We can decrease the constant to decrease the scratch buffer size.<br>
>  Â  Â  Â  Â  *<br>
>  Â  Â  Â  Â  * sctx->scratch_waves must be >= the maximum posible size of<br>
>  Â  Â  Â  Â  * 1 threadgroup, so that the hw doesn't hang from being unable<br>
>  Â  Â  Â  Â  * to start any.<br>
>  Â  Â  Â  Â  *<br>
>  Â  Â  Â  Â  * The recommended value is 4 per CU at most. Higher numbers don't<br>
> diff --git a/src/gallium/drivers/<wbr>radeonsi/si_compute.c b/src/gallium/drivers/<wbr>radeonsi/si_compute.c<br>
> index ac4fab3..91d6810 100644<br>
> --- a/src/gallium/drivers/<wbr>radeonsi/si_compute.c<br>
> +++ b/src/gallium/drivers/<wbr>radeonsi/si_compute.c<br>
> @@ -152,22 +152,21 @@ static void *si_create_compute_state(<br>
>  Â  Â  Â  Â struct si_context *sctx = (struct si_context *)ctx;<br>
>  Â  Â  Â  Â struct si_screen *sscreen = (struct si_screen *)ctx->screen;<br>
>  Â  Â  Â  Â struct si_compute *program = CALLOC_STRUCT(si_compute);<br>
><br>
>  Â  Â  Â  Â pipe_reference_init(&program-><wbr>reference, 1);<br>
>  Â  Â  Â  Â program->screen = (struct si_screen *)ctx->screen;<br>
>  Â  Â  Â  Â program->ir_type = cso->ir_type;<br>
>  Â  Â  Â  Â program->local_size = cso->req_local_mem;<br>
>  Â  Â  Â  Â program->private_size = cso->req_private_mem;<br>
>  Â  Â  Â  Â program->input_size = cso->req_input_mem;<br>
> -  Â  Â  Â program->use_code_object_v2 = HAVE_LLVM >= 0x0400 &&<br>
> -  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â cso->ir_type == PIPE_SHADER_IR_NATIVE;<br>
> +  Â  Â  Â program->use_code_object_v2 = cso->ir_type == PIPE_SHADER_IR_NATIVE;<br>
><br>
>  Â  Â  Â  Â if (cso->ir_type == PIPE_SHADER_IR_TGSI) {<br>
>  Â  Â  Â  Â  Â  Â  Â  Â program->tokens = tgsi_dup_tokens(cso->prog);<br>
>  Â  Â  Â  Â  Â  Â  Â  Â if (!program->tokens) {<br>
>  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â FREE(program);<br>
>  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â return NULL;<br>
>  Â  Â  Â  Â  Â  Â  Â  Â }<br>
><br>
>  Â  Â  Â  Â  Â  Â  Â  Â program->compiler_ctx_state.<wbr>debug = sctx->debug;<br>
>  Â  Â  Â  Â  Â  Â  Â  Â program->compiler_ctx_state.<wbr>is_debug_context = sctx->is_debug;<br>
> diff --git a/src/gallium/drivers/<wbr>radeonsi/si_get.c b/src/gallium/drivers/<wbr>radeonsi/si_get.c<br>
> index 36e6018..46d5eee 100644<br>
> --- a/src/gallium/drivers/<wbr>radeonsi/si_get.c<br>
> +++ b/src/gallium/drivers/<wbr>radeonsi/si_get.c<br>
> @@ -182,24 +182,22 @@ static int si_get_param(struct pipe_screen *pscreen, enum pipe_cap param)<br>
>  Â  Â  Â  Â case PIPE_CAP_MEMOBJ:<br>
>  Â  Â  Â  Â case PIPE_CAP_LOAD_CONSTBUF:<br>
>  Â  Â  Â  Â case PIPE_CAP_INT64:<br>
>  Â  Â  Â  Â case PIPE_CAP_INT64_DIVMOD:<br>
>  Â  Â  Â  Â case PIPE_CAP_TGSI_CLOCK:<br>
>  Â  Â  Â  Â case PIPE_CAP_CAN_BIND_CONST_<wbr>BUFFER_AS_VERTEX:<br>
>  Â  Â  Â  Â case PIPE_CAP_ALLOW_MAPPED_BUFFERS_<wbr>DURING_EXECUTION:<br>
>  Â  Â  Â  Â case PIPE_CAP_TGSI_ANY_REG_AS_<wbr>ADDRESS:<br>
>  Â  Â  Â  Â case PIPE_CAP_SIGNED_VERTEX_BUFFER_<wbr>OFFSET:<br>
>  Â  Â  Â  Â case PIPE_CAP_TGSI_FS_FBFETCH:<br>
> -  Â  Â  Â  Â  Â  Â  Â return 1;<br>
> -<br>
>  Â  Â  Â  Â case PIPE_CAP_TGSI_VOTE:<br>
> -  Â  Â  Â  Â  Â  Â  Â return HAVE_LLVM >= 0x0400;<br>
> +  Â  Â  Â  Â  Â  Â  Â return 1;<br>
><br>
>  Â  Â  Â  Â case PIPE_CAP_TGSI_BALLOT:<br>
>  Â  Â  Â  Â  Â  Â  Â  Â return HAVE_LLVM >= 0x0500;<br>
><br>
>  Â  Â  Â  Â case PIPE_CAP_RESOURCE_FROM_USER_<wbr>MEMORY:<br>
>  Â  Â  Â  Â  Â  Â  Â  Â return !SI_BIG_ENDIAN && sscreen->info.has_userptr;<br>
><br>
>  Â  Â  Â  Â case PIPE_CAP_DEVICE_RESET_STATUS_<wbr>QUERY:<br>
>  Â  Â  Â  Â  Â  Â  Â  Â return (sscreen->info.drm_major == 2 &&<br>
>  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â sscreen->info.drm_minor >= 43) ||<br>
> @@ -737,28 +735,23 @@ static unsigned get_max_threads_per_block(<wbr>struct si_screen *screen,<br>
>  static int si_get_compute_param(struct pipe_screen *screen,<br>
>  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â enum pipe_shader_ir ir_type,<br>
>  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â enum pipe_compute_cap param,<br>
>  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â void *ret)<br>
>  {<br>
>  Â  Â  Â  Â struct si_screen *sscreen = (struct si_screen *)screen;<br>
><br>
>  Â  Â  Â  Â //TODO: select these params by asic<br>
>  Â  Â  Â  Â switch (param) {<br>
>  Â  Â  Â  Â case PIPE_COMPUTE_CAP_IR_TARGET: {<br>
> -  Â  Â  Â  Â  Â  Â  Â const char *gpu;<br>
> -  Â  Â  Â  Â  Â  Â  Â const char *triple;<br>
> -<br>
> -  Â  Â  Â  Â  Â  Â  Â if (HAVE_LLVM < 0x0400)<br>
> -  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â triple = "amdgcn--";<br>
> -  Â  Â  Â  Â  Â  Â  Â else<br>
> -  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â triple = "amdgcn-mesa-mesa3d";<br>
> +  Â  Â  Â  Â  Â  Â  Â const char *gpu, *triple;<br>
><br>
> +  Â  Â  Â  Â  Â  Â  Â triple = "amdgcn-mesa-mesa3d";<br>
>  Â  Â  Â  Â  Â  Â  Â  Â gpu = ac_get_llvm_processor_name(<wbr>sscreen->info.family);<br>
>  Â  Â  Â  Â  Â  Â  Â  Â if (ret) {<br>
>  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â sprintf(ret, "%s-%s", gpu, triple);<br>
>  Â  Â  Â  Â  Â  Â  Â  Â }<br>
>  Â  Â  Â  Â  Â  Â  Â  Â /* +2 for dash and terminating NIL byte */<br>
>  Â  Â  Â  Â  Â  Â  Â  Â return (strlen(triple) + strlen(gpu) + 2) * sizeof(char);<br>
>  Â  Â  Â  Â }<br>
>  Â  Â  Â  Â case PIPE_COMPUTE_CAP_GRID_<wbr>DIMENSION:<br>
>  Â  Â  Â  Â  Â  Â  Â  Â if (ret) {<br>
>  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â uint64_t *grid_dimension = ret;<br>
> diff --git a/src/gallium/drivers/<wbr>radeonsi/si_shader_tgsi_mem.c b/src/gallium/drivers/<wbr>radeonsi/si_shader_tgsi_mem.c<br>
> index b5fad34..ec1de40 100644<br>
> --- a/src/gallium/drivers/<wbr>radeonsi/si_shader_tgsi_mem.c<br>
> +++ b/src/gallium/drivers/<wbr>radeonsi/si_shader_tgsi_mem.c<br>
> @@ -289,31 +289,30 @@ static void image_append_args(<br>
>  Â  Â  Â  Â LLVMValueRef i1true = LLVMConstInt(ctx->i1, 1, 0);<br>
>  Â  Â  Â  Â LLVMValueRef r128 = i1false;<br>
>  Â  Â  Â  Â LLVMValueRef da = tgsi_is_array_image(target) ? i1true : i1false;<br>
>  Â  Â  Â  Â LLVMValueRef glc =<br>
>  Â  Â  Â  Â  Â  Â  Â  Â force_glc ||<br>
>  Â  Â  Â  Â  Â  Â  Â  Â inst->Memory.Qualifier & (TGSI_MEMORY_COHERENT | TGSI_MEMORY_VOLATILE) ?<br>
>  Â  Â  Â  Â  Â  Â  Â  Â i1true : i1false;<br>
>  Â  Â  Â  Â LLVMValueRef slc = i1false;<br>
>  Â  Â  Â  Â LLVMValueRef lwe = i1false;<br>
><br>
> -  Â  Â  Â if (atomic || (HAVE_LLVM <= 0x0309)) {<br>
> +  Â  Â  Â if (atomic) {<br>
>  Â  Â  Â  Â  Â  Â  Â  Â emit_data->args[emit_data-><wbr>arg_count++] = r128;<br>
>  Â  Â  Â  Â  Â  Â  Â  Â emit_data->args[emit_data-><wbr>arg_count++] = da;<br>
>  Â  Â  Â  Â  Â  Â  Â  Â if (!atomic) {<br>
>  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â emit_data->args[emit_data-><wbr>arg_count++] = glc;<br>
>  Â  Â  Â  Â  Â  Â  Â  Â }<br>
>  Â  Â  Â  Â  Â  Â  Â  Â emit_data->args[emit_data-><wbr>arg_count++] = slc;<br>
>  Â  Â  Â  Â  Â  Â  Â  Â return;<br>
>  Â  Â  Â  Â }<br>
><br>
> -  Â  Â  Â /* HAVE_LLVM >= 0x0400 */<br>
>  Â  Â  Â  Â emit_data->args[emit_data-><wbr>arg_count++] = glc;<br>
>  Â  Â  Â  Â emit_data->args[emit_data-><wbr>arg_count++] = slc;<br>
>  Â  Â  Â  Â emit_data->args[emit_data-><wbr>arg_count++] = lwe;<br>
>  Â  Â  Â  Â emit_data->args[emit_data-><wbr>arg_count++] = da;<br>
>  }<br>
><br>
>  /**<br>
>  Â * Append the resource and indexing arguments for buffer intrinsics.<br>
>  Â *<br>
>  Â * \param rsrc the v4i32 buffer resource<br>
> diff --git a/src/gallium/drivers/<wbr>radeonsi/si_shader_tgsi_setup.<wbr>c b/src/gallium/drivers/<wbr>radeonsi/si_shader_tgsi_setup.<wbr>c<br>
> index f70e2bd..44294f2 100644<br>
> --- a/src/gallium/drivers/<wbr>radeonsi/si_shader_tgsi_setup.<wbr>c<br>
> +++ b/src/gallium/drivers/<wbr>radeonsi/si_shader_tgsi_setup.<wbr>c<br>
> @@ -1371,24 +1371,22 @@ void si_llvm_optimize_module(struct si_shader_context *ctx)<br>
>  Â  Â  Â  Â LLVMAddAlwaysInlinerPass(<wbr>gallivm->passmgr);<br>
><br>
>  Â  Â  Â  Â /* This pass should eliminate all the load and store instructions */<br>
>  Â  Â  Â  Â LLVMAddPromoteMemoryToRegister<wbr>Pass(gallivm->passmgr);<br>
><br>
>  Â  Â  Â  Â /* Add some optimization passes */<br>
>  Â  Â  Â  Â LLVMAddScalarReplAggregatesPas<wbr>s(gallivm->passmgr);<br>
>  Â  Â  Â  Â LLVMAddLICMPass(gallivm-><wbr>passmgr);<br>
>  Â  Â  Â  Â LLVMAddAggressiveDCEPass(<wbr>gallivm->passmgr);<br>
>  Â  Â  Â  Â LLVMAddCFGSimplificationPass(<wbr>gallivm->passmgr);<br>
> -#if HAVE_LLVM >= 0x0400<br>
>  Â  Â  Â  Â /* This is recommended by the instruction combining pass. */<br>
>  Â  Â  Â  Â LLVMAddEarlyCSEMemSSAPass(<wbr>gallivm->passmgr);<br>
> -#endif<br>
>  Â  Â  Â  Â LLVMAddInstructionCombiningPas<wbr>s(gallivm->passmgr);<br>
><br>
>  Â  Â  Â  Â /* Run the pass */<br>
>  Â  Â  Â  Â LLVMRunPassManager(gallivm-><wbr>passmgr, ctx->gallivm.module);<br>
><br>
>  Â  Â  Â  Â LLVMDisposeBuilder(ctx->ac.<wbr>builder);<br>
>  Â  Â  Â  Â LLVMDisposePassManager(<wbr>gallivm->passmgr);<br>
>  Â  Â  Â  Â gallivm_dispose_target_<wbr>library_info(target_library_<wbr>info);<br>
>  }<br>
><br>
> --<br>
> 2.7.4<br>
><br>
</div></div>> ______________________________<wbr>_________________<br>
> mesa-dev mailing list<br>
> <a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
> <a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/mesa-dev</a><br>
</blockquote></div><br></div>