Sam Parker
2012-Nov-26 22:24 UTC
[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.
Duncan Sands
2012-Nov-27 08:17 UTC
[LLVMdev] inserting a target specific builtin in llvm pass
Hi Sam,> 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?you don't have to do anything special for intrinsics, you can just declare them like any other function declaration. Ciao, Duncan.
Zhao, Weiming
2012-Nov-27 22:05 UTC
[LLVMdev] inserting a target specific builtin in llvm pass
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
Seemingly Similar Threads
- [LLVMdev] How to get the return address on the stack on LLVM
- [LLVMdev] Replacing instruction in LLVM IR by an intrinsics
- [LLVMdev] how can I create an SSE instrinsics sqrt?
- [LLVMdev] Replacing instruction in LLVM IR by an intrinsics
- [LLVMdev] Bogus assert in VMCore/Instructions.cpp CallInst::Create?