search for: createcall

Displaying 20 results from an estimated 172 matches for "createcall".

2013 Dec 26
2
[LLVMdev] Arguments to IRBuilder CreateCall function
Hi, I need to pass some arguments to CreateCall function (as Value *). For example, I need to pass a 64 bit integer (with a value I calculate). How can I convert the 64 bit integer to a value * in order to pass it? Thanks a lot, Tehila. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.ll...
2010 Jun 26
2
[LLVMdev] IRBuilder<>::CreateCall, CreateCall2, CreateCall3, ...
Hey guys, Whys are there like 5 variants of CreateCall in IRBuilder<> with numbers appended to them? The only difference I can see is the number of arguments. Aren't C++ function overloads be suited for this? Félix
2010 Jun 26
0
[LLVMdev] IRBuilder<>::CreateCall, CreateCall2, CreateCall3, ...
On Jun 25, 2010, at 6:24 PM, Félix Cloutier wrote: > Hey guys, > > Whys are there like 5 variants of CreateCall in IRBuilder<> with numbers appended to them? The only difference I can see is the number of arguments. Aren't C++ function overloads be suited for this? An overload could work, but this sort of API makes it more obvious which one you're trying to call and avoids overload ambiguity e...
2020 Feb 27
3
How to set DebugLoc when using IRBuilder's CreateCall ?
Hi I want to insert some functions into the llvm bitcode ir files. So I use IRBuilder and CreateCall(). But it how error : inlinable function call in a function with debug info must have a !dbg location. I don't know what DebugLoc should I give the new CallInst to setDebugLoc. I Create this CallInst , so this CallInst doesn't hava so-called "DebugLoc" mapping to the source co...
2020 Jun 09
5
Preventing function call from being optimized out in LTO
Hello, I am adding function calls to an LLVM link-time optimization (LTO) pass, using the IRBuilder::CreateCall method. I want these calls to remain in the final x86 binary at any optimization level, but on levels -O2 and -O3, some of these calls are being optimized out. So far, I've tried adding each function in the program (excluding LLVM intrinsics) to the llvm.used set, and I've also set noinlin...
2016 Jun 13
2
LLVM IR intrinsics placeholder for strings [was Re: Back end with special loop instructions (using LLVM IR intrinsics)]
...ode generation time.) More exactly, I would like to give something LIKE this in a middle-tier pass (I haven't tried this code in LLVM): Value *instrinsicFunc = Intrinsic::getDeclaration(M, Intrinsic::my_intrinsic); myIRBuilder.CreateCall(repeatFunc, "string_that_llc_codegen_should_output_as_assembly"); So my intrinsic would be accepting a general string which will be used at codegen to be output. I guess I would have to define it like this in a .td file: def int_my_intrinsic : Intrinsic<[], [string]...
2012 Jul 04
1
[LLVMdev] Non-tail calls
Hi all. I am using LLVM to develop a procedural language. Can anybody point me to an example that uses CreateCall for a non-tail call? I am having trouble doing anything with the return value from the call besides returning it immediately. i.e. Passing the CallInst created by CreateCall to CreateRet is working fine, but I am having trouble storing the returned value in a local variable or passing it to anoth...
2017 Mar 31
2
How to write the same things as `opt` command in C++ API
...et()); // Body of the `a` function { /// @brief Set entry label llvm::BasicBlock *block = llvm::BasicBlock::Create(context, "entry", aFun); /// @brief builder llvm::IRBuilder<> builder(block); builder.SetInsertPoint(block); llvm::CallInst *cCall = builder.CreateCall(cFun, {}, "c"); llvm::Value *res = cCall; builder.CreateRet(res); llvm::verifyFunction(*aFun); } // Body of the `b` function { /// @brief Set entry label llvm::BasicBlock *block = llvm::BasicBlock::Create(context, "entry", bFun); /// @brief builder...
2014 Dec 10
4
PJSIP configuration question
...they sent me. type=friend dtmfmode=auto host=64.2.142.93 allow=all nat=yes canreinvite=no trustrpid=yes sendrpid=yes When I use these settings to originate calls using the sip.conf they sent me, everything works. Action: Originate ActionID: S8 Channel: SIP/outbound.vitelity.net/8005555555 Exten: createcall Context: TestApp Priority: 1 Timeout: 60000 CallerID: John Doe <1234> Variable: CALLERID(num-pres)=allowed_passed_screened Async: true I translated those settings to the following for pjsip.conf... [transport1] type = transport bind = 0.0.0.0 protocol = udp [outbound.vitelity.net] type =...
2020 Jun 09
2
Implementing a VTable in LLVM
..., i32)*, void (%Foo*, i32)** %8 However, the builder->CreateLoad instruction corresponding to the line with %9 returns null: llvm::Function *calleeMethod = llvm::dyn_cast<llvm::Function>(builder->CreateLoad(calleeMethodPtr)); So if I then try to execute the following builder->CreateCall function I end up with a segmentation fault since calleeMethod is null: builder->CreateCall(calleeMethod, argVals); Under what circumstances would builder->CreateLoad return null? Is the global vTable's memory not allocated correctly? Or have I been approaching this incorrectly - is...
2011 May 09
1
[LLVMdev] CreateAddO / CreateUAddO etc in IRBuilder
I guess currently we do not have these arithmetic with overflow variants in IRBuilder . So CreateCall is the only way to do it. Is it a good idea to add them into the IRBuilder? even thought they are in turn implemented with CreateCall only? - sanjiv -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110509/c4...
2016 Mar 29
2
JIT compiler and calls to existing functions
...all int64_t print(int64_t) looks like: auto f = builder.CreateIntToPtr( ConstantInt::get(builder.getInt64Ty(), uintptr_t(print)), PointerType::getUnqual(FunctionType::get( builder.getInt64Ty(), {builder.getInt64Ty()}, false))); return builder.CreateCall(f, args); On Mon, Mar 28, 2016 at 1:40 PM, Caldarale, Charles R < Chuck.Caldarale at unisys.com> wrote: > > From: llvm-dev [mailto:llvm-dev-bounces at lists.llvm.org] > > On Behalf Of Russell Wallace via llvm-dev > > Subject: [llvm-dev] JIT compiler and calls to existing...
2017 Nov 16
2
About mismatching calling conventions
...rone. Maybe we should either: - update the API to enforce the CC when building a ``CallInst`` - update LangRef to state that mismatching CC in static call is an error (note that LangRef is unclear about static call, the quote only references indirect calls) - add an optional setting in the ``CreateCall`` that enforces CC (and let it default to yes?) Any thoughts on that? Serge
2017 Jun 11
2
Force casting a Value*
.... Let me explain my intention first. I want to retrieve the value (if isPointerTy() returns true) to be stored by a store instruction at run-time and pass on that value as either an unsigned int (64) or a pointer (char*) to an external function. The call to that function is inserted using IRBuilder.CreateCall(). Consider the code snippet below. ================================================== if (StoreInst *store_inst = dyn_cast<StoreInst>(&I)) { Value* vo = store_inst->getValueOperand(); uint64 var_value = /* cast vo to unsigned int 64 bit */...
2013 Aug 28
1
[LLVMdev] Casting and intrinsic function calls
...ty) const { return b->CreateFPCast(i, ty, n); } \\b is an IRBuilder and TheModule is an llvm::Module Value *intrinsic(Value *i, Intrinsic::ID id) const { vector<Type*> args; args.push_back(i->getType()); Function *intrinsic = Intrinsic::getDeclaration(TheModule, id, args); return b->CreateCall(intrinsic, i, n); } Value *log(Value *i) const { i = castFP(i, Type::getDoubleTy(getGlobalContext())); return intrinsic(i, Intrinsic::log); } In this example the initial type of i on the log function call is a Float (tested and confirmed) but when I run the code I get- Assertion failed: (getOpera...
2015 Mar 24
2
[LLVMdev] IR blocks for calling function pointers
...Module class as follows: std::vector<Type*> FooArgs; FooArgs.push_back(IRB.getInt64Ty()); Value *FooFunction = M.getOrInsertFunction(std::string("foo"), FunctionType::get(IRB.getVoidTy(), ArrayRef<Type*>(FooArgs), false)); IRB.CreateCall(FooFunction, IRB.CreateLoad(LenAlloca)); I want to create a similar call, but to the pointer of foo ("foo_ptr" is defined as "(void) *foo_ptr (int)"). In C code, I would just call "foo_ptr(var)", and it would just work. But, replacing the function name with the name o...
2017 Jun 12
2
Force casting a Value*
...t; first. I want to retrieve the value (if isPointerTy() returns true) to be >> stored by a store instruction at run-time and pass on that value as either >> an unsigned int (64) or a pointer (char*) to an external function. The call >> to that function is inserted using IRBuilder.CreateCall(). >> >> Consider the code snippet below. >> >> ================================================== >> >> if (StoreInst *store_inst = dyn_cast<StoreInst>(&I)) { >> Value* vo = store_inst->getValueOperand(); >>...
2015 Nov 12
4
Fwd: asan for allocas on powerpc64
...ckrestore instruction). The call function is created something like this (paraphrasing from lib/Transfoms/Instrumentation/AddressSanitizer.cpp): // call __asan_allocas_unpoison(uptr top, uptr bottom); // NB "top" here means lowest address and "bottom" means highest! IRB.CreateCall( AsanAllocasUnpoisonFunc, { IRB.CreateLoad(DynamicAllocaLayout), IRB.CreatePointerToInt(SaveRestoreInst->getOperand(0), IntptrTy) } ); I think the problem is that the operand to stackrestore is the new native sp register value to restore, and this code is assuming that...
2016 Mar 29
0
JIT compiler and calls to existing functions
...oks like: > > auto f = builder.CreateIntToPtr( > ConstantInt::get(builder.getInt64Ty(), uintptr_t(print)), > PointerType::getUnqual(FunctionType::get( > builder.getInt64Ty(), {builder.getInt64Ty()}, false))); > return builder.CreateCall(f, args); > > > On Mon, Mar 28, 2016 at 1:40 PM, Caldarale, Charles R > <Chuck.Caldarale at unisys.com <mailto:Chuck.Caldarale at unisys.com>> wrote: > > > From: llvm-dev [mailto:llvm-dev-bounces at lists.llvm.org > <mailto:llvm-dev-bounces at lists.l...
2020 Jun 09
3
Preventing function call from being optimized out in LTO
...ng to preserve the function calls for? > > On Tue, Jun 9, 2020 at 11:01 AM Shishir V Jessu via llvm-dev < > llvm-dev at lists.llvm.org> wrote: > >> Hello, >> >> I am adding function calls to an LLVM link-time optimization (LTO) pass, >> using the IRBuilder::CreateCall method. I want these calls to remain in >> the final x86 binary at any optimization level, but on levels -O2 and -O3, >> some of these calls are being optimized out. >> >> So far, I've tried adding each function in the program (excluding LLVM >> intrinsics) to the...