From e94b040add069900bd2aac18e05b219d1be156b5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Sun, 4 Dec 2022 04:30:16 -0500 Subject: [PATCH] ac/llvm: remove illegal function attributes READONLY and WRITEONLY They are only legal on parameters. Reviewed-by: Pierre-Eric Pelloux-Prayer Part-of: --- src/amd/llvm/ac_llvm_build.c | 3 +-- src/amd/llvm/ac_llvm_util.c | 4 ---- src/amd/llvm/ac_llvm_util.h | 6 +----- src/amd/llvm/ac_nir_to_llvm.c | 2 +- 4 files changed, 3 insertions(+), 12 deletions(-) diff --git a/src/amd/llvm/ac_llvm_build.c b/src/amd/llvm/ac_llvm_build.c index cd1724ae..40d5ff4 100644 --- a/src/amd/llvm/ac_llvm_build.c +++ b/src/amd/llvm/ac_llvm_build.c @@ -4343,8 +4343,7 @@ LLVMValueRef ac_build_load_helper_invocation(struct ac_llvm_context *ctx) LLVMValueRef result; if (LLVM_VERSION_MAJOR >= 13) { - result = ac_build_intrinsic(ctx, "llvm.amdgcn.live.mask", ctx->i1, NULL, 0, - AC_FUNC_ATTR_READONLY); + result = ac_build_intrinsic(ctx, "llvm.amdgcn.live.mask", ctx->i1, NULL, 0, 0); } else { result = ac_build_intrinsic(ctx, "llvm.amdgcn.ps.live", ctx->i1, NULL, 0, AC_FUNC_ATTR_READNONE); diff --git a/src/amd/llvm/ac_llvm_util.c b/src/amd/llvm/ac_llvm_util.c index a82f5ef..f98ef4f 100644 --- a/src/amd/llvm/ac_llvm_util.c +++ b/src/amd/llvm/ac_llvm_util.c @@ -261,10 +261,6 @@ static const char *attr_to_str(enum ac_func_attr attr) return "nounwind"; case AC_FUNC_ATTR_READNONE: return "readnone"; - case AC_FUNC_ATTR_READONLY: - return "readonly"; - case AC_FUNC_ATTR_WRITEONLY: - return "writeonly"; case AC_FUNC_ATTR_CONVERGENT: return "convergent"; default: diff --git a/src/amd/llvm/ac_llvm_util.h b/src/amd/llvm/ac_llvm_util.h index 6fd4a5f..919dead 100644 --- a/src/amd/llvm/ac_llvm_util.h +++ b/src/amd/llvm/ac_llvm_util.h @@ -47,8 +47,6 @@ enum ac_func_attr AC_FUNC_ATTR_NOALIAS = (1 << 3), AC_FUNC_ATTR_NOUNWIND = (1 << 4), AC_FUNC_ATTR_READNONE = (1 << 5), - AC_FUNC_ATTR_READONLY = (1 << 6), - AC_FUNC_ATTR_WRITEONLY = (1 << 7), AC_FUNC_ATTR_CONVERGENT = (1 << 8), }; @@ -104,9 +102,7 @@ void ac_llvm_set_target_features(LLVMValueRef F, struct ac_llvm_context *ctx); static inline unsigned ac_get_load_intr_attribs(bool can_speculate) { - /* READNONE means writes can't affect it, while READONLY means that - * writes can affect it. */ - return can_speculate ? AC_FUNC_ATTR_READNONE : AC_FUNC_ATTR_READONLY; + return can_speculate ? AC_FUNC_ATTR_READNONE : 0; } LLVMTargetLibraryInfoRef ac_create_target_library_info(const char *triple); diff --git a/src/amd/llvm/ac_nir_to_llvm.c b/src/amd/llvm/ac_nir_to_llvm.c index 796fb2e..4ca98bc 100644 --- a/src/amd/llvm/ac_nir_to_llvm.c +++ b/src/amd/llvm/ac_nir_to_llvm.c @@ -2667,7 +2667,7 @@ static LLVMValueRef visit_image_load(struct ac_nir_context *ctx, const nir_intri if (!level_zero) args.lod = get_src(ctx, instr->src[3]); args.dmask = 15; - args.attributes = AC_FUNC_ATTR_READONLY; + args.attributes = 0; assert(instr->dest.is_ssa); args.d16 = instr->dest.ssa.bit_size == 16; -- 2.7.4