From b5744310d4a282d4f58dbc62659c5f50416730d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Fri, 24 Feb 2017 02:11:07 +0100 Subject: [PATCH] gallivm, ac: add writeonly and inaccessiblememonly attributes Reviewed-by: Dave Airlie --- src/amd/common/ac_llvm_util.c | 2 ++ src/amd/common/ac_llvm_util.h | 2 ++ src/gallium/auxiliary/gallivm/lp_bld_intr.c | 2 ++ src/gallium/auxiliary/gallivm/lp_bld_intr.h | 2 ++ 4 files changed, 8 insertions(+) diff --git a/src/amd/common/ac_llvm_util.c b/src/amd/common/ac_llvm_util.c index 1936014525b..2598875ab70 100644 --- a/src/amd/common/ac_llvm_util.c +++ b/src/amd/common/ac_llvm_util.c @@ -172,6 +172,8 @@ static const char *attr_to_str(enum ac_func_attr attr) case AC_FUNC_ATTR_NOUNWIND: 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_INACCESSIBLE_MEM_ONLY: return "inaccessiblememonly"; default: fprintf(stderr, "Unhandled function attribute: %x\n", attr); return 0; diff --git a/src/amd/common/ac_llvm_util.h b/src/amd/common/ac_llvm_util.h index 805db771785..e786bb73371 100644 --- a/src/amd/common/ac_llvm_util.h +++ b/src/amd/common/ac_llvm_util.h @@ -41,6 +41,8 @@ enum ac_func_attr { AC_FUNC_ATTR_NOUNWIND = (1 << 4), AC_FUNC_ATTR_READNONE = (1 << 5), AC_FUNC_ATTR_READONLY = (1 << 6), + AC_FUNC_ATTR_WRITEONLY = HAVE_LLVM >= 0x0400 ? (1 << 7) : 0, + AC_FUNC_ATTR_INACCESSIBLE_MEM_ONLY = HAVE_LLVM >= 0x0400 ? (1 << 8) : 0, /* Legacy intrinsic that needs attributes on function declarations * and they must match the internal LLVM definition exactly, otherwise diff --git a/src/gallium/auxiliary/gallivm/lp_bld_intr.c b/src/gallium/auxiliary/gallivm/lp_bld_intr.c index 0b25ae5d9d6..07d31029c3e 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_intr.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_intr.c @@ -150,6 +150,8 @@ static const char *attr_to_str(enum lp_func_attr attr) case LP_FUNC_ATTR_NOUNWIND: return "nounwind"; case LP_FUNC_ATTR_READNONE: return "readnone"; case LP_FUNC_ATTR_READONLY: return "readonly"; + case LP_FUNC_ATTR_WRITEONLY: return "writeonly"; + case LP_FUNC_ATTR_INACCESSIBLE_MEM_ONLY: return "inaccessiblememonly"; default: _debug_printf("Unhandled function attribute: %x\n", attr); return 0; diff --git a/src/gallium/auxiliary/gallivm/lp_bld_intr.h b/src/gallium/auxiliary/gallivm/lp_bld_intr.h index 0032df5ceac..7bd6efa4568 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_intr.h +++ b/src/gallium/auxiliary/gallivm/lp_bld_intr.h @@ -54,6 +54,8 @@ enum lp_func_attr { LP_FUNC_ATTR_NOUNWIND = (1 << 4), LP_FUNC_ATTR_READNONE = (1 << 5), LP_FUNC_ATTR_READONLY = (1 << 6), + LP_FUNC_ATTR_WRITEONLY = HAVE_LLVM >= 0x0400 ? (1 << 7) : 0, + LP_FUNC_ATTR_INACCESSIBLE_MEM_ONLY = HAVE_LLVM >= 0x0400 ? (1 << 8) : 0, /* Legacy intrinsic that needs attributes on function declarations * and they must match the internal LLVM definition exactly, otherwise