<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
It sounds like you're hitting the default case in
SelectionDAGBuilder::visitIntrinsicCall and exercising the
visitTargetIntrinsic code path. I haven't dug into the default
handling there, but that's probably what you need to look at.
Depending on your intrinsic, you might also consider adding custom
handling in visitIntrinsicCall itself.<br>
<br>
<div class="moz-cite-prefix">On 03/21/2016 04:33 PM, Xiangyang Guo
via llvm-dev wrote:<br>
</div>
<blockquote
cite="mid:CAApsxOE9uswHVnk9qO72-+XATHXe2c7kjKDKZ8zkXQ=65Qootw@mail.gmail.com"
type="cite">
<div dir="ltr">Hi,
<div><br>
</div>
<div>If I define a intrinsic function with pointer-typed
parameter, for example, </div>
<div>def llvm_foo_ptr_ty :
LLVMPointerType<llvm_i16_ty>;<br>
</div>
<div>def int_foo_get : Intrinsic<[llvm_foo_ptr_ty],
[llvm_foo_ptr_ty, llvm_i32_ty], [IntrReadArgMem]>;<br>
</div>
<div><br>
</div>
<div>How to lower it for the backend? I'm not sure what kind of
register (i16 or i32 or i32) is needed in this case? If the
parameter is LLVMPointerType<llvm_i32_ty> instead of
LLVMPointerType<llvm_i16_ty>, will this make difference
for the backend? Suppose my backend has three types of
register: i16, i32, i64.</div>
<div><br>
</div>
<div>When I check the debug information, I can see LLVM tries to
use i32 to lower the parameter to build SDAG. But why it
chooses i32 instead of i64? <br>
</div>
</div>
</blockquote>
This sounds like your target isn't telling the canonicalization
logic i16 is a valid register type or that the cost of i32 register
is much less than an i16. However, I'm no expert in the backend
stuff, so take my comment with a grain of salt. <br>
<blockquote
cite="mid:CAApsxOE9uswHVnk9qO72-+XATHXe2c7kjKDKZ8zkXQ=65Qootw@mail.gmail.com"
type="cite">
<div dir="ltr">
<div><br>
</div>
<div>Any input is appreciable. </div>
<div><br>
</div>
<div>Regards,</div>
<div><br>
</div>
<div>Xiangyang</div>
</div>
<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>