[LLVMdev] A simple question regarding LLVM intrinsics.

Gil Dogon gil.dogon at mobileye.com
Thu Feb 26 05:25:56 PST 2009


Hi. My name is Gil Dogon and I am working in MobileEye using LLVM  in 
order  to generate code for a proprietary processor.
Our processor architecture is very similar to MIPS, so I started to work 
using the "experimental" MIPS back end.

Anyway, my  question is rather simple but somehow I did not find a quick 
answer to it in the documentation.

What I want to know, is how can the llvm.<something> intrinsics be used  
by the application  programmer.

As a simple example take the llvm.ctlz intrinsic.  How does one use it 
from C program ??

I guess there must be a ".h" file somewhere which defines some of those 
intrinsics for "C" and maybe some modification
for the llvm-gcc frontend is involved...

The question is more general. I guess some of the intrinsics are just 
for internal use by the LLVM passes, but in that case maybe
it would have been better to have them as LLVM  IR instructions, if they 
are real intrinsics there should be a mechanism
which makes them visible somehow to the "C" programmer so they can be 
used  ......



More information about the llvm-dev mailing list