<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Feb 15, 2016, at 11:34 AM, Artur Pilipenko via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class="">

<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" class="">

<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><p style="margin: 0px 0px 12px; padding: 0px; border: 0px; widows: 1; background-color: rgb(255, 255, 255);" class="">
<font face="Segoe UI, Segoe UI Web Regular, Segoe UI Symbol, Helvetica Neue, Helvetica, Arial, sans-serif" size="2" class=""><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 face="Segoe UI, Segoe UI Web Regular, Segoe UI Symbol, Helvetica Neue, Helvetica, Arial, sans-serif" size="2" class=""><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><div class=""><br class=""></div></div></div></blockquote><div><br class=""></div><div><div>How would the "typeless" pointer interact with this? Would the problem be solved?</div><div>(just curious)</div><div><br class=""></div><div>-- </div><div>Mehdi</div><div class=""><br class=""></div></div><br class=""><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><p style="margin: 0px 0px 12px; padding: 0px; border: 0px; widows: 1; background-color: rgb(255, 255, 255);" class="">
<font face="Segoe UI, Segoe UI Web Regular, Segoe UI Symbol, Helvetica Neue, Helvetica, Arial, sans-serif" size="2" class=""><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 face="Segoe UI, Segoe UI Web Regular, Segoe UI Symbol, Helvetica Neue, Helvetica, Arial, sans-serif" size="2" class=""><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 face="Segoe UI, Segoe UI Web Regular, Segoe UI Symbol, Helvetica Neue, Helvetica, Arial, sans-serif" size="2" class=""><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 face="Segoe UI, Segoe UI Web Regular, Segoe UI Symbol, Helvetica Neue, Helvetica, Arial, sans-serif" size="2" class=""><span style="line-height: 18.850000381469727px;" class="">Corresponding patch is posted on phabricator:
<a href="http://reviews.llvm.org/D17270" class="">http://reviews.llvm.org/D17270</a></span></font></p><p style="margin: 0px 0px 12px; padding: 0px; border: 0px; widows: 1; background-color: rgb(255, 255, 255);" class="">
<font face="Segoe UI, Segoe UI Web Regular, Segoe UI Symbol, Helvetica Neue, Helvetica, Arial, sans-serif" size="2" class=""><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 face="Segoe UI, Segoe UI Web Regular, Segoe UI Symbol, Helvetica Neue, Helvetica, Arial, sans-serif" size="2" class=""><span style="line-height: 18.850000381469727px;" class="">Artur</span></font></p>
</div>

_______________________________________________<br class="">LLVM Developers mailing list<br class=""><a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a><br class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev<br class=""></div></blockquote></div><br class=""></body></html>