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

Tim Northover via llvm-dev llvm-dev at lists.llvm.org
Thu Oct 22 13:17:50 PDT 2015

On 22 October 2015 at 13:14, Xiangyang Guo <eceguo at gmail.com> wrote:
> I just put the definition of int_foo in file include/llvm/IR/Intrinsics.td
> like this "def int_foo : Intrinsic<[llvm_i32_ty], [llvm_i32_ty,
> llvm_i32_ty], [IntrReadArgMem]>;", is that a problem? Is a separate file
> IntrinsicsMyTarget.td necessary in this case?

It depends on use (Intrinsics.td is for target-agnostic ones), but
would probably be advised if the intrinsic is target-specific. It's
obviously up to you for a local project though.

In any case, I think the problem is that the ".i32.i32" in
"@llvm.foo.i32.i32" is only needed if you use llvm_anyint_ty (or
similar) for some of the parameters. In this case the declaration
should be simply "declare i32 @llvm.foo(i32, i32)".



More information about the llvm-dev mailing list