[cfe-dev] Adding an intrinsic that the user can include in source code

Martin J. O'Riordan via cfe-dev cfe-dev at lists.llvm.org
Tue Oct 31 15:56:08 PDT 2017


I suspect that you almost certainly need to also implement a handler for this in the function ‘CodeGenFunction::EmitX86BuiltinExpr’ in:

 

tools/clang/lib/CodeGen/CGBuiltin.cpp

 

All the best,

 

MartinO

 

From: cfe-dev [mailto:cfe-dev-bounces at lists.llvm.org] On Behalf Of Seth Goldstein via cfe-dev
Sent: 31 October 2017 22:20
To: cfe-dev at lists.llvm.org <mailto:cfe-dev at lists.llvm.org> 
Subject: [cfe-dev] Adding an intrinsic that the user can include in source code

 

I would like to add an intrinsic that the user can put in their code.

The intrinsic is for sending, ala MPI, a value to another processor.

I have read the short document,

https://llvm.org/docs/ExtendingLLVM.html, about adding intrinsics but

must be missing something because it doesn't mention changing anything

in clang.  I added my intrinsic to

llvm/include/llvm/IR/IntrinsicsX86.td, then I added it to

clang/include/clang/Basic/BuiltinsX86.def.  When I compile my code I get:

 

send.c:14:3: error: cannot compile this builtin function yet

  __builtin_uli_send0(1, 0, &incr);

  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

 

The AST has information about my intrinsic and the parameters, but not

sure how to proceed.

 

What am I missing?

 

 

--------------

Seth Copen Goldstein

Carnegie Mellon University

Computer Science Dept

7111 GHC

412-268-3828

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20171031/6000c31a/attachment.html>


More information about the cfe-dev mailing list