[llvm-dev] add intrinsic function support for customized backend

Xiangyang Guo via llvm-dev llvm-dev at lists.llvm.org
Thu Oct 22 07:52:15 PDT 2015


Hi, All,

I want to add one intrinsic function for my particular backend. Let's say
the intrinsic function is named "foo" which takes two i32 inputs and has
one i32 output.

First, I add this line "def int_foo : Intrinsic<[llvm_i32_ty],
[llvm_i32_ty, llvm_i32_ty], [IntrReadArgMem]>;" in
/include/llvm/IR/Intrinsics.td.

Then, in my target/InstrInfo.td, I'm supposed to add one pattern to match
this intrinsic function. However, I don't understand how LLVM can tell the
difference between this intrinsic function call and other normal function
calls. From the IR, I can see both intrinsic functions and other normal
functions use 'call'.

So my question is how to add intrinsic function support for customized
backend? Any hint/suggestion is appreciable.

Regards,

Xiangyang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20151022/40a3e934/attachment.html>


More information about the llvm-dev mailing list