diff options
author | Nicolai Hähnle <[email protected]> | 2019-01-10 22:59:58 +0100 |
---|---|---|
committer | Nicolai Hähnle <[email protected]> | 2019-01-14 08:30:12 +0100 |
commit | e4803ab7d2b61178e45985684457a34982ffb3c4 (patch) | |
tree | b999129a9205b61f632fb60e74bacd47b386a80e /src/amd/common | |
parent | 1c1ae6376c5cc6d3c2c20647aa6838f4fedd8f05 (diff) |
amd/common: use llvm.amdgcn.s.buffer.load for LLVM 8.0
llvm.SI.load.const is deprecated.
Reviewed-by: Bas Nieuwenhuizen <[email protected]>
Diffstat (limited to 'src/amd/common')
-rw-r--r-- | src/amd/common/ac_llvm_build.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/amd/common/ac_llvm_build.c b/src/amd/common/ac_llvm_build.c index 76047148a6a..4d7f15901e3 100644 --- a/src/amd/common/ac_llvm_build.c +++ b/src/amd/common/ac_llvm_build.c @@ -1241,11 +1241,15 @@ ac_build_buffer_load(struct ac_llvm_context *ctx, offset = LLVMBuildAdd(ctx->builder, offset, LLVMConstInt(ctx->i32, 4, 0), ""); } - LLVMValueRef args[2] = {rsrc, offset}; - result[i] = ac_build_intrinsic(ctx, "llvm.SI.load.const.v4i32", - ctx->f32, args, 2, + const char *intrname = + HAVE_LLVM >= 0x0800 ? "llvm.amdgcn.s.buffer.load.f32" + : "llvm.SI.load.const"; + unsigned num_args = HAVE_LLVM >= 0x0800 ? 3 : 2; + LLVMValueRef args[3] = {rsrc, offset, ctx->i32_0}; + result[i] = ac_build_intrinsic(ctx, intrname, + ctx->f32, args, num_args, AC_FUNC_ATTR_READNONE | - AC_FUNC_ATTR_LEGACY); + (HAVE_LLVM < 0x0800 ? AC_FUNC_ATTR_LEGACY : 0)); } if (num_channels == 1) return result[0]; |