<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
And.. ignore me. I clearly hadn't read your email closely enough.
This is exactly what you were doing.<br>
<br>
Philip<br>
<br>
<div class="moz-cite-prefix">On 02/16/2016 09:27 AM, Philip Reames
via llvm-dev wrote:<br>
</div>
<blockquote cite="mid:56C35C1A.9060304@philipreames.com" type="cite">
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
I don't think you need to change the signatures to get what you
want.<br>
<br>
The current definition is:<br>
def int_masked_store : Intrinsic<[], [llvm_anyvector_ty,
LLVMPointerTo<0>,<br>
llvm_i32_ty,<br>
LLVMVectorSameWidth<0,
llvm_i1_ty>],<br>
[IntrReadWriteArgMem]>;<br>
<br>
If I'm remembering my Intrinsics.td syntax correctly, you can
simply change this to:<br>
def int_masked_store : Intrinsic<[], [llvm_anyvector_ty,
llvm_anyptr_ty,<br>
llvm_i32_ty,<br>
LLVMVectorSameWidth<0,
llvm_i1_ty>],<br>
[IntrReadWriteArgMem]>;<br>
<br>
Philip<br>
<br>
<br>
<div class="moz-cite-prefix">On 02/15/2016 11:34 AM, Artur
Pilipenko via llvm-dev wrote:<br>
</div>
<blockquote
cite="mid:2A9A5F61-1A90-4608-8FD1-82F29ED0EE5E@azulsystems.com"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=utf-8">
<p style="margin: 0px 0px 12px; padding: 0px; border: 0px;
widows: 1; background-color: rgb(255, 255, 255);" class=""> <font
class="" face="Segoe UI, Segoe UI Web Regular, Segoe UI
Symbol, Helvetica Neue, Helvetica, Arial, sans-serif"
size="2"><span style="line-height: 18.850000381469727px;"
class="">Masked load/store are overloaded intrinsics, the
only generic type is the type of the value being
loaded/stored. The signature of the intrinsic is generated
based on this type. The type of the pointer argument is
generated as a pointer to the return type with default
addrspace. E.g.:</span></font></p>
<p style="margin: 0px 0px 12px; padding: 0px; border: 0px;
widows: 1; background-color: rgb(255, 255, 255);" class=""> <font
class="" face="Segoe UI, Segoe UI Web Regular, Segoe UI
Symbol, Helvetica Neue, Helvetica, Arial, sans-serif"
size="2"><span style="line-height: 18.850000381469727px;"
class="">declare <8 x i32>
@llvm.masked.load.v8i32(<8 x i32>*, i32, <8 x
i1>, <8 x i32>)</span></font></p>
<p style="margin: 0px 0px 12px; padding: 0px; border: 0px;
widows: 1; background-color: rgb(255, 255, 255);" class=""> <font
class="" face="Segoe UI, Segoe UI Web Regular, Segoe UI
Symbol, Helvetica Neue, Helvetica, Arial, sans-serif"
size="2"><span style="line-height: 18.850000381469727px;"
class="">The problem occurs when loop-vectorize tries to
use @llvm.masked.load/store intrinsic for a non-default
addrspace pointer. It fails with "Calling a function with
a bad signature!" assertion in CallInst constructor
because it tries to pass a non-default addrspace pointer
to the pointer argument which has default addrspace.</span></font></p>
<p style="margin: 0px 0px 12px; padding: 0px; border: 0px;
widows: 1; background-color: rgb(255, 255, 255);" class=""> <font
class="" face="Segoe UI, Segoe UI Web Regular, Segoe UI
Symbol, Helvetica Neue, Helvetica, Arial, sans-serif"
size="2"><span style="line-height: 18.850000381469727px;"
class="">My proposal to fix the problem is to add another
overloaded type parameter for the intrinsics - the pointer
type, which can be any pointer with underlying type being
a data type. In this case the signature of the intrinsic
above would be:</span></font></p>
<p style="margin: 0px 0px 12px; padding: 0px; border: 0px;
widows: 1; background-color: rgb(255, 255, 255);" class=""> <font
class="" face="Segoe UI, Segoe UI Web Regular, Segoe UI
Symbol, Helvetica Neue, Helvetica, Arial, sans-serif"
size="2"><span style="line-height: 18.850000381469727px;"
class="">declare <8 x i32>
@llvm.masked.load.v8i32.p1v8i32(<8 x i32>
addrspace(1)*, i32, <8 x i1>, <8 x i32>)</span></font></p>
<p style="margin: 0px 0px 12px; padding: 0px; border: 0px;
widows: 1; background-color: rgb(255, 255, 255);" class=""> <font
class="" face="Segoe UI, Segoe UI Web Regular, Segoe UI
Symbol, Helvetica Neue, Helvetica, Arial, sans-serif"
size="2"><span style="line-height: 18.850000381469727px;"
class="">Corresponding patch is posted on phabricator: <a
moz-do-not-send="true"
href="http://reviews.llvm.org/D17270" class=""><a class="moz-txt-link-freetext" href="http://reviews.llvm.org/D17270">http://reviews.llvm.org/D17270</a></a></span></font></p>
<p style="margin: 0px 0px 12px; padding: 0px; border: 0px;
widows: 1; background-color: rgb(255, 255, 255);" class=""> <font
class="" face="Segoe UI, Segoe UI Web Regular, Segoe UI
Symbol, Helvetica Neue, Helvetica, Arial, sans-serif"
size="2"><span style="line-height: 18.850000381469727px;"
class="">Any comments, objections or alternatives?</span></font></p>
<p style="margin: 0px 0px 12px; padding: 0px; border: 0px;
widows: 1; background-color: rgb(255, 255, 255);" class=""> <font
class="" face="Segoe UI, Segoe UI Web Regular, Segoe UI
Symbol, Helvetica Neue, Helvetica, Arial, sans-serif"
size="2"><span style="line-height: 18.850000381469727px;"
class="">Artur</span></font></p>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
LLVM Developers mailing list
<a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a>
</pre>
</blockquote>
<br>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
LLVM Developers mailing list
<a class="moz-txt-link-abbreviated" href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>
<a class="moz-txt-link-freetext" href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a>
</pre>
</blockquote>
<br>
</body>
</html>