search for: getcalledvalu

Displaying 20 results from an estimated 46 matches for "getcalledvalu".

Did you mean: getcalledvalue
2012 Nov 09
2
[LLVMdev] Inlining bitcast functions...
..._tDv2_iDv4_f to void (%9 addrspace(1)*, <2 x i32>, <4 x float>)*)(%9 addrspace(1)* %dstimg, <2 x i32> %28, <4 x float> %26) nounwind %4 and %9 are both (stripped) opaque structs. InlineFunction() does not inline this because call->getCalledFunction() returns 0. call->getCalledValue() returns a cast ConstantExpr. The called Function * is available at (leaving out necessary casts and checks) call->getCalledValue()->getOperand(0). I've tried using call->setCalledFunction(), but that isn't successful either, I'm guessing because the types don't match. I...
2010 May 16
1
[LLVMdev] How to access the return value of a CallInst
...d during the optimization pass I wrote. I have something like the following: CallInst *InitCall = CallInst::Create(InitFn, Args.begin(), Args.end(), "log_load_addr_ret", LI); CastInst *InsertedCast = CastInst::CreateTruncOrBitCast(InitCall.getCalledValue(), LI->getType(), "return_load", LI); I assume that getCalledValue() will give me the return value of the InitCall CallInst. This compiles fine. But the CastInst cannot be created. The runtime error is : opt: /panfs/panasas-01.cs.wisc.edu/scratch/wang/LLVM/src/llvm/lib/VMCor...
2012 Nov 09
0
[LLVMdev] Inlining bitcast functions...
...id (%9 addrspace(1)*, <2 x i32>, <4 x float>)*)(%9 addrspace(1)* %dstimg, <2 x i32> %28, <4 x float> %26) nounwind > > %4 and %9 are both (stripped) opaque structs. > > InlineFunction() does not inline this because call->getCalledFunction() returns 0. call->getCalledValue() returns a cast ConstantExpr. The called Function * is available at (leaving out necessary casts and checks) call->getCalledValue()->getOperand(0). I've tried using call->setCalledFunction(), but that isn't successful either, I'm guessing because the types don't match. &g...
2014 Jul 07
2
[LLVMdev] Return Type of Call Function with nested bitcast
Hi All, I am facing an issue with CallInst with nested bitcast instruction. I want to check if the return type of a call is void or non-void the below line works well for CallInst without bit cast. *cast<CallInst>(I)->getCalledFunction()->getReturnType()->isVoidTy()* But for Call instructions like *call void bitcast (void (%struct.jpeg_compress_struct.131*, i32)*
2012 Jul 17
1
[LLVMdev] [DragonEgg] Why Fortran's "call flush()" is converted to "call void bitcast (void (...)* @_gfortran_flush_i4 to void (i8*)*)(i8* null) nounwind" ?
Thanks, Duncan, makes sense! I suppose you meant something like this: Function* callee = dyn_cast<Function>( call->getCalledValue()->stripPointerCasts()); if (!callee) continue; - D. 2012/7/17 Duncan Sands <baldrick at free.fr> > Hi Dmitry, it would be neater to use stripPointerCasts. > > Ciao, Duncan. > > > OK, at our end the following workaround seems to be sufficient: >...
2012 Jul 17
2
[LLVMdev] [DragonEgg] Why Fortran's "call flush()" is converted to "call void bitcast (void (...)* @_gfortran_flush_i4 to void (i8*)*)(i8* null) nounwind" ?
...act function from the underlying constant expression. // Required to workaround GCC/DragonEGG issue: // http://lists.cs.uiuc.edu/pipermail/llvmdev/2012-July/051786.html ConstantExpr* expr = dyn_cast<ConstantExpr>(call->getCalledValue()); if (!expr) continue; callee = dyn_cast<Function>(expr->getOperand(0)); } *Hopefully* there will be no more gcc-generated special cases :) Thanks, - D. 2012/7/17 Duncan Sands <baldrick at free.fr> > Hi Ant...
2012 Jul 17
0
[LLVMdev] [DragonEgg] Why Fortran's "call flush()" is converted to "call void bitcast (void (...)* @_gfortran_flush_i4 to void (i8*)*)(i8* null) nounwind" ?
...> constant expression. > // Required to workaround GCC/DragonEGG issue: > // > http://lists.cs.uiuc.edu/pipermail/llvmdev/2012-July/051786.html > ConstantExpr* expr = > dyn_cast<ConstantExpr>(call->getCalledValue()); > if (!expr) continue; > callee = dyn_cast<Function>(expr->getOperand(0)); > } > > *Hopefully* there will be no more gcc-generated special cases :) > > Thanks, > - D. > > 2012/7/17 Dun...
2018 Jun 03
2
Retrieving the name of a indirect virtual method call in LLVM pass
...to retrieve the name of the function in the case of virtual method calls. For example: struct A { A() {} virtual foo() {} virtual ~A() {} }; int main() { A* a = new A; a->foo(); } In the pass, I can determine the name of the indirect call by using CallInst::getCalledValue(), but that doesn't give any information on the actual method that is being called, which should be foo(). The only "name" I can get is the type of the class, in which this case is class.A. Is there any way I can get the name of the virtual method (foo) that is being invoked? It...
2011 Jan 26
2
[LLVMdev] [LLVMDEV]How could I get function name in this situation?
...t;> >> The dump result of the function call I want to find is : >> >> call void %7(%struct.nsAString* %8, i32 0) nounwind, !dbg !1565 > > This is a call using a function pointer. There is no function name to > retrieve. You can check the called value (pcall->getCalledValue()) and > see if it's something like a cast instruction that casts a constant > function value, but that case is probably unlikely. > > -- John T. > >> it returns null from pCall->getCalledFunction(), and I cannot get the >> function name. >> >> H...
2013 Feb 11
2
[LLVMdev] How to get type of a call instruction
I need to get the type of a call instruction to typecast a (void*) pointer to the type of the function which is called. How can I achieve that? -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130211/6a044cde/attachment.html>
2013 Feb 11
0
[LLVMdev] How to get type of a call instruction
...gt; writes: > CallInst::getCalledFunction followed by Function::getFunctionType does not > work for indirect calls, because getCalledFunction returns NULL for > indirect calls, and my focus is indirect calls. Any idea how to get the > Function Type from indirect calls? Maybe CallInst::getCalledValue ? getCalledValue - Get a pointer to the function that is invoked by this instruction Note that it returns a Value*, not a Function*. Then you can use Value::getType.
2013 Dec 17
2
[LLVMdev] tail call
I have a pass which operates on IR for mips16 so that I can build stubs and such for floating point. I usually get this attribute of the call instruction getCalledFunction. This is turning out to be null when there is a tail call. (I think this may be something new but maybe was there already). So then what is the right way to find the function prototype for the call? TIA. Reed
2013 Dec 17
0
[LLVMdev] tail call
...gt; This is turning out to be null when there is a tail call. (I think this > may be something new but maybe was there already). > > So then what is the right way to find the function prototype for the call? > > TIA. > > Reed I'm guessing that maybe I should be using CI->getCalledValue().VTy Where CI is the call instruction. ???
2011 Oct 17
2
[LLVMdev] Variable name from metadata
...IVariable DV(mdnode1); Value *v = mdnode1->getOperand(0);//gives add 0x69   3. I have written below code to reach till variable name.        LLVMIname is                 const CallInst *CI = dyn_cast<CallInst>(Insn);               const Value* LLVMIValue  = cast<CallInst>(Insn)->getCalledValue();               const Function *LLVMIFunc= dyn_cast<Function>(LLVMIValue);                             if( LLVMIname.compare("llvm.dbg.declare") == 0 )                             {                               int x = 0;                 int numoperands = CI->getNumArgOperand...
2011 Jan 26
2
[LLVMdev] [LLVMDEV]How could I get function name in this situation?
...result of the function call I want to find is : >>>> >>>> call void %7(%struct.nsAString* %8, i32 0) nounwind, !dbg !1565 >>> This is a call using a function pointer. There is no function name to >>> retrieve. You can check the called value (pcall->getCalledValue()) and >>> see if it's something like a cast instruction that casts a constant >>> function value, but that case is probably unlikely. >>> >>> -- John T. >>> >>>> it returns null from pCall->getCalledFunction(), and I cannot get &...
2011 Jan 26
0
[LLVMdev] [LLVMDEV]How could I get function name in this situation?
...; > } > } > > The dump result of the function call I want to find is : > > call void %7(%struct.nsAString* %8, i32 0) nounwind, !dbg !1565 This is a call using a function pointer. There is no function name to retrieve. You can check the called value (pcall->getCalledValue()) and see if it's something like a cast instruction that casts a constant function value, but that case is probably unlikely. -- John T. > it returns null from pCall->getCalledFunction(), and I cannot get the > function name. > > How could I get the function name in t...
2011 Jan 26
2
[LLVMdev] [LLVMDEV]How could I get function name in this situation?
Hi: My llvm code is: for( BasicBlock::iterator i = b->begin() , ie = b->end(); b != be ; b ++ ){ if( CallInst * pCall = dyn_cast<CallInst>(i)){ pCall->dump(); // Function * pFunction = pCall->getCalledFunction(); if( !pFunction ){ } std::string fname = pFunction->getName(); } } The dump result
2012 Jan 03
1
[LLVMdev] AliasAnalysis and memory dependency
i am sorry, i get this error: opt: /home/llvm/src/include/llvm/Support/CallSite.h:87: ValTy* llvm::CallSiteBase<FunTy, ValTy, UserTy, InstrTy, CallTy, InvokeTy, IterTy>::getCalledValue() const [with FunTy = const llvm::Function, ValTy = const llvm::Value, UserTy = const llvm::User, InstrTy = const llvm::Instruction, CallTy = const llvm::CallInst, InvokeTy = const llvm::InvokeInst, IterTy = const llvm::Use*]: Assertion `getInstruction() && "Not a call or invoke instr...
2018 Sep 12
2
CallSiteBase::getCalledFunction and non-trivial calls
...wered, and we simply do not support indirect calls. However, we should be able to support these bitcast calls, as they are effectively direct for our purposes, but the CallGraph does not seem to consider them (it uses .getCalledFunction()). Maybe a new function for `dyn_cast<Function>(CS.getCalledValue()->stripPointerCasts())` would make sense? I am not sure if this is valid to use in CallGraph, but it does not care about arguments as far as I can tell. At the very least I can try to clarify the docs, because until you explained it I had a different definition of "indirect call"...
2011 Jan 26
0
[LLVMdev] [LLVMDEV]How could I get function name in this situation?
...t; The dump result of the function call I want to find is : >>> >>> call void %7(%struct.nsAString* %8, i32 0) nounwind, !dbg !1565 >> This is a call using a function pointer. There is no function name to >> retrieve. You can check the called value (pcall->getCalledValue()) and >> see if it's something like a cast instruction that casts a constant >> function value, but that case is probably unlikely. >> >> -- John T. >> >>> it returns null from pCall->getCalledFunction(), and I cannot get the >>> function...