[LLVMdev] About implementing new intrinsic

Chris Lattner sabre at nondot.org
Sat Mar 31 20:22:49 PDT 2007


On Sat, 31 Mar 2007, Ferad Zyulkyarov wrote:
> I will try to explain by giving an example.
> Let's say that I have an intrinsic: int llvm.myintrinsic(int)
> I have a function: int myintrinsic_handler(int)
> When
> %var = call int %llvm.myintrinsic( int %arg )
> is met in the code, I want the code generator put in its place: a call
> to function
> "myintrinsic_handler" (i.e. %var = call int %myintrinsic_handler( int %arg ) )

This is exactly what intrinsic lowering does.  To answer your other email, 
LLVM 1.9 also has this related stuff, including bswap:
http://llvm.org/releases/1.9/docs/LangRef.html

-Chris

-- 
http://nondot.org/sabre/
http://llvm.org/



More information about the llvm-dev mailing list