[LLVMdev] inserting a target specific builtin in llvm pass

Zhao, Weiming weimingz at quicinc.com
Tue Nov 27 14:05:57 PST 2012


You can do like this:
Function *MyFunc = Intrinsic::getDeclaration(M, Intrinsic::my_instrinc);
CallInst::Create(Myfunc, Args, "", InsertBefore);


-----Original Message-----
From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu] On Behalf Of Sam Parker
Sent: Monday, November 26, 2012 2:25 PM
To: llvmdev at cs.uiuc.edu
Subject: [LLVMdev] inserting a target specific builtin in llvm pass

Hi,

I'm writing a pass which needs to insert an intrinsic in for my target, but I'm not sure how to create the call. I've tried defining a function, with the target intrinsic as its name, and then creating a new CallInst to call it. But how am I supposed to declare this function as an intrinsic?

Thanks,

Sam



--
View this message in context: http://llvm.1065342.n5.nabble.com/inserting-a-target-specific-builtin-in-llvm-pass-tp51823.html
Sent from the LLVM - Dev mailing list archive at Nabble.com.
_______________________________________________
LLVM Developers mailing list
LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev




More information about the llvm-dev mailing list