<div dir="ltr"><div>Thanks for this</div><div><br></div>Tested-and-reviewed-by: Mike Lothian <<a href="mailto:mike@fireburn.co.uk">mike@fireburn.co.uk</a>><br></div><br><div class="gmail_quote"><div dir="ltr">On Thu, 20 Apr 2017 at 09:48 Nicolai Hähnle <<a href="mailto:nhaehnle@gmail.com">nhaehnle@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 20.04.2017 10:34, Christoph Haag wrote:<br>
> v2: previously getWithDereferenceableBytes() exists, but addAttr() doesn't take that type<br>
><br>
> Signed-off-by: Christoph Haag <haagch+mesadev@frickel.club><br>
<br>
Reviewed-by: Nicolai Hähnle <<a href="mailto:nicolai.haehnle@amd.com" target="_blank">nicolai.haehnle@amd.com</a>><br>
<br>
<br>
> ---<br>
>  src/amd/common/ac_llvm_helper.cpp | 4 ++++<br>
>  1 file changed, 4 insertions(+)<br>
><br>
> diff --git a/src/amd/common/ac_llvm_helper.cpp b/src/amd/common/ac_llvm_helper.cpp<br>
> index d9ea4b162e..11fa80920d 100644<br>
> --- a/src/amd/common/ac_llvm_helper.cpp<br>
> +++ b/src/amd/common/ac_llvm_helper.cpp<br>
> @@ -44,9 +44,13 @@ typedef AttributeSet AttributeList;<br>
>  void ac_add_attr_dereferenceable(LLVMValueRef val, uint64_t bytes)<br>
>  {<br>
>     llvm::Argument *A = llvm::unwrap<llvm::Argument>(val);<br>
> +#if HAVE_LLVM < 0x0500<br>
>     llvm::AttrBuilder B;<br>
>     B.addDereferenceableAttr(bytes);<br>
>     A->addAttr(llvm::AttributeList::get(A->getContext(), A->getArgNo() + 1,  B));<br>
> +#else<br>
> +   A->addAttr(llvm::Attribute::getWithDereferenceableBytes(A->getContext(), bytes));<br>
> +#endif<br>
>  }<br>
><br>
>  bool ac_is_sgpr_param(LLVMValueRef arg)<br>
><br>
<br>
<br>
--<br>
Lerne, wie die Welt wirklich ist,<br>
Aber vergiss niemals, wie sie sein sollte.<br>
_______________________________________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org" target="_blank">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/mailman/listinfo/mesa-dev</a><br>
</blockquote></div>