<div dir="auto"><div><br><div class="gmail_extra"><br><div class="gmail_quote">On Feb 26, 2017 1:09 AM, "Jan Vesely" <<a href="mailto:jan.vesely@rutgers.edu">jan.vesely@rutgers.edu</a>> wrote:<br type="attribution"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="quoted-text">On Sun, 2017-02-26 at 00:58 +0100, Marek Olšák wrote:<br>
> From: Marek Olšák <<a href="mailto:marek.olsak@amd.com">marek.olsak@amd.com</a>><br>
><br>
> ---<br>
> src/amd/common/ac_llvm_util.c | 2 ++<br>
> src/amd/common/ac_llvm_util.h | 2 ++<br>
> src/gallium/auxiliary/gallivm/<wbr>lp_bld_intr.c | 2 ++<br>
> src/gallium/auxiliary/gallivm/<wbr>lp_bld_intr.h | 2 ++<br>
> 4 files changed, 8 insertions(+)<br>
><br>
> diff --git a/src/amd/common/ac_llvm_util.<wbr>c b/src/amd/common/ac_llvm_util.<wbr>c<br>
> index fb525dd..3cc06d4 100644<br>
> --- a/src/amd/common/ac_llvm_util.<wbr>c<br>
> +++ b/src/amd/common/ac_llvm_util.<wbr>c<br>
> @@ -165,20 +165,22 @@ static LLVMAttribute ac_attr_to_llvm_attr(enum ac_func_attr attr)<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_BYVAL: return "byval";<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>
<br>
</div>does this not give "error: duplicate case value" when compiled with<br>
LLVM-3.9 ?<br></blockquote></div></div></div><div dir="auto"><br></div><div dir="auto">This code is not built with LLVM 3.9.</div><div dir="auto"><br></div><div dir="auto">Marek</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<font color="#888888"><br>
Jan<br>
</font><div class="elided-text"><br>
> default:<br>
> fprintf(stderr, "Unhandled function attribute: %x\n", attr);<br>
> return 0;<br>
> }<br>
> }<br>
><br>
> #endif<br>
><br>
> static void<br>
> ac_add_function_attr(<wbr>LLVMContextRef ctx, LLVMValueRef function,<br>
> diff --git a/src/amd/common/ac_llvm_util.<wbr>h b/src/amd/common/ac_llvm_util.<wbr>h<br>
> index 4fe4ab4..1cdee2e 100644<br>
> --- a/src/amd/common/ac_llvm_util.<wbr>h<br>
> +++ b/src/amd/common/ac_llvm_util.<wbr>h<br>
> @@ -34,20 +34,22 @@ extern "C" {<br>
> #endif<br>
><br>
> enum ac_func_attr {<br>
> AC_FUNC_ATTR_ALWAYSINLINE = (1 << 0),<br>
> AC_FUNC_ATTR_BYVAL = (1 << 1),<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>
><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>
> LLVMTargetMachineRef ac_create_target_machine(enum radeon_family family, bool supports_spill);<br>
><br>
> diff --git a/src/gallium/auxiliary/<wbr>gallivm/lp_bld_intr.c b/src/gallium/auxiliary/<wbr>gallivm/lp_bld_intr.c<br>
> index 1b50e68..0be57c9 100644<br>
> --- a/src/gallium/auxiliary/<wbr>gallivm/lp_bld_intr.c<br>
> +++ b/src/gallium/auxiliary/<wbr>gallivm/lp_bld_intr.c<br>
> @@ -143,20 +143,22 @@ static LLVMAttribute lp_attr_to_llvm_attr(enum lp_func_attr attr)<br>
> static const char *attr_to_str(enum lp_func_attr attr)<br>
> {<br>
> switch (attr) {<br>
> case LP_FUNC_ATTR_ALWAYSINLINE: return "alwaysinline";<br>
> case LP_FUNC_ATTR_BYVAL: return "byval";<br>
> case LP_FUNC_ATTR_INREG: return "inreg";<br>
> case LP_FUNC_ATTR_NOALIAS: return "noalias";<br>
> case LP_FUNC_ATTR_NOUNWIND: return "nounwind";<br>
> case LP_FUNC_ATTR_READNONE: return "readnone";<br>
> case LP_FUNC_ATTR_READONLY: return "readonly";<br>
> + case LP_FUNC_ATTR_WRITEONLY: return "writeonly";<br>
> + case LP_FUNC_ATTR_INACCESSIBLE_MEM_<wbr>ONLY: return "inaccessiblememonly";<br>
> default:<br>
> _debug_printf("Unhandled function attribute: %x\n", attr);<br>
> return 0;<br>
> }<br>
> }<br>
><br>
> #endif<br>
><br>
> void<br>
> lp_add_function_attr(<wbr>LLVMContextRef ctx, LLVMValueRef function,<br>
> diff --git a/src/gallium/auxiliary/<wbr>gallivm/lp_bld_intr.h b/src/gallium/auxiliary/<wbr>gallivm/lp_bld_intr.h<br>
> index d279911..4d14725 100644<br>
> --- a/src/gallium/auxiliary/<wbr>gallivm/lp_bld_intr.h<br>
> +++ b/src/gallium/auxiliary/<wbr>gallivm/lp_bld_intr.h<br>
> @@ -47,20 +47,22 @@<br>
> #define LP_MAX_FUNC_ARGS 32<br>
><br>
> enum lp_func_attr {<br>
> LP_FUNC_ATTR_ALWAYSINLINE = (1 << 0),<br>
> LP_FUNC_ATTR_BYVAL = (1 << 1),<br>
> LP_FUNC_ATTR_INREG = (1 << 2),<br>
> LP_FUNC_ATTR_NOALIAS = (1 << 3),<br>
> LP_FUNC_ATTR_NOUNWIND = (1 << 4),<br>
> LP_FUNC_ATTR_READNONE = (1 << 5),<br>
> LP_FUNC_ATTR_READONLY = (1 << 6),<br>
> + LP_FUNC_ATTR_WRITEONLY = HAVE_LLVM >= 0x0400 ? (1 << 7) : 0,<br>
> + LP_FUNC_ATTR_INACCESSIBLE_MEM_<wbr>ONLY = HAVE_LLVM >= 0x0400 ? (1 << 8) : 0,<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>
> LP_FUNC_ATTR_LEGACY = (1u << 31),<br>
> };<br>
><br>
> void<br>
> lp_format_intrinsic(char *name,<br>
</div></blockquote></div><br></div></div></div>