search for: createcall3

Displaying 15 results from an estimated 15 matches for "createcall3".

Did you mean: createcall
2013 Dec 03
1
[LLVMdev] Help with creating and replacing instructions in LLVM
...y IR- %call2 = call i8* @strcpy(i8* %1, i8* %2) #2 I intend to change call to strcpy with strncpy. I have included the following code in runOnFunction, so that when it is strcpy's turn to be invoked, strncpy is invoked instead. Assuming I* is the strcpy instruction, CallInst* x=new CallInst::CreateCall3(strncpy,1,2,ConstantInt(16),llvm::Twine("my_strncpy")); ReplaceInstWithInst(I*,x); I'm running into a whole bunch of errors in CreateCall3(). How can I go about writing this correctly? Any help would be appreciated. Thanks. -------------- next part -------------- An HTML attachment...
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
2013 Dec 03
1
[LLVMdev] Help needed with creating new and replacing an old instruction
...on in my IR-%call2 = call i8* @strcpy(i8* %1, i8* %2) #2I intend to change call to strcpy with strncpy. I have included the following code in runOnFunction, so that when it is strcpy's turn to be invoked, strncpy is invoked instead.Assuming I* is the strcpy instruction,CallInst* x=new CallInst::CreateCall3(strncpy,1,2,ConstantInt(16),"my_strncpy");ReplaceInstWithInst(I*,x);I'm running into a whole bunch of errors in CreateCall3(). How can I go about writing this correctly?Any help would be appreciated.Thanks.Marc----email.biz access any email create any email -------------- next part...
2015 Nov 24
2
How to create a sprintf call in IR
...); Now, I got stuck to create teh function call for sprintf. I didn't it like the following: Value* str = builder.CreateGlobalStringPtr("str", ""); Value* data = builder.CreateLoad(a); //load a, b, or c Value* buf = builder.CreateLoad(buffer); builder.CreateCall3((value*)sprintf, buf, str, data); I want to test the sprintf function before adding the offset, but it didn't work. The error information is "llvm.sys:PrintStackTrace(_IO_FILE)". Any help will be appreciated. Best, Zhi -------------- next part -------------- An HTML attachment was s...
2013 Dec 03
0
[LLVMdev] Help needed with creating new and replacing an old instruction
...he following code in runOnFunction, so that when it is strcpy's turn to be invoked, strncpy is invoked instead.</div><div><br></div><div>Assuming I* is the strcpy instruction,</div><div><br></div><div><b>CallInst* x=new CallInst::CreateCall3(strncpy,1,2,ConstantInt(16),"my_strncpy");</b></div><div><b>ReplaceInstWithInst(I*,x);</b></div><div><br></div><div>I'm running into a whole bunch of errors in CreateCall3(). How can I go about writing this correctly?</div...
2011 May 12
2
[LLVMdev] Extract operations as function
...n. > When it > sees a binary operator ("isa<BinaryOperator>(Instruction)") it needs to > first > insert a call just in front of the instruction (see an IRBuilder to do > this; > use "SetInsertPoint(Instruction)" to tell it where to add the call; use > CreateCall3 to create the call). Then use replaceAllUsesWith to replace > every > use of the binary operator with the call you just created. Finally, delete > the > original instruction (eraseFromParent). > > Ciao, Duncan. > > > > > Is codeExtractor.cpp useful for this. I was...
2011 May 12
0
[LLVMdev] Extract operations as function
...and all instructions in the function. When it sees a binary operator ("isa<BinaryOperator>(Instruction)") it needs to first insert a call just in front of the instruction (see an IRBuilder to do this; use "SetInsertPoint(Instruction)" to tell it where to add the call; use CreateCall3 to create the call). Then use replaceAllUsesWith to replace every use of the binary operator with the call you just created. Finally, delete the original instruction (eraseFromParent). Ciao, Duncan. > > Is codeExtractor.cpp useful for this. I was also thinking of going like > loop-extr...
2011 May 12
2
[LLVMdev] Extract operations as function
Hi, I am planning to extract every operation as function. eg. z=x+y; ==> z=func(x,y,op); I wish to write a custom definition of op. Which I would like to define in func. It would be really helpful if someone could suggest passes already available in llvm to look for or point some references how should one proceed on it. Is codeExtractor.cpp useful for this. I was also thinking of going like
2011 May 12
0
[LLVMdev] Extract operations as function
.... When it > sees a binary operator ("isa<BinaryOperator>(Instruction)") it needs to first > insert a call just in front of the instruction (see an IRBuilder to do this; > use "SetInsertPoint(Instruction)" to tell it where to add the call; use > CreateCall3 to create the call). Then use replaceAllUsesWith to replace every > use of the binary operator with the call you just created. Finally, delete the > original instruction (eraseFromParent). > > Ciao, Duncan. > > > > > Is codeExtractor.cpp useful for...
2013 Nov 26
0
[LLVMdev] Help needed with a pass
...; Twine temp=new Twine("tmp"); IRBuilder<> builder(Entry); Value* envVarDoesntExist = builder.CreateICmpEQ(new StringRef(pPath),Constant::getNullValue(StringRef),temp); builder.CreateCondBr(envVarDoesntExist, False, True); builder.SetInsertPoint(True); builder.CreateCall3(strncpy_func,buf,new StringRef(pPath),29,temp); builder.SetInsertPoint(False); builder.CreateCall(printf_func,"Set <SOME_ENV_VAR>\n",temp); return mod; }} char funcP::ID = 0;static RegisterPass<funcP> X("funcp", "f...
2014 Feb 21
12
[LLVMdev] asan coverage
...y = llvm::FunctionType::get(PGOBuilder.getVoidTy(), Args, false); @@ -209,9 +210,10 @@ llvm::Constant *MangledName = CGM.GetAddrOfConstantCString(CGM.getMangledName(GD), "__llvm_pgo_name"); MangledName = llvm::ConstantExpr::getBitCast(MangledName, Int8PtrTy); - PGOBuilder.CreateCall3(EmitFunc, MangledName, + PGOBuilder.CreateCall4(EmitFunc, MangledName, PGOBuilder.getInt32(NumRegionCounters), - PGOBuilder.CreateBitCast(RegionCounters, Int64PtrTy)); + PGOBuilder.CreateBitCast(RegionCounters, Int64PtrTy),...
2014 Feb 19
2
[LLVMdev] asan coverage
I've built chromium with " -fprofile-instr-generate -fsanitize=address" -- the performance looks good! The file format from r198638 is indeed rudimentary. Do you already know how the real output format will look like? Just to summarize what I think is important: - minimal size on disk, minimal amount of files - minimal i/o while writing to disk, no lockf or some such -
2011 Aug 31
0
[LLVMdev] [PATCH] Split init.trampoline into init.trampoline & adjust.trampoline
..., > + (Type *)0)); I think you should use Intrinsic::getDeclaration to get AdjustTrampolineFn. > + > + IRBuilder<> Builder(C); > + Builder.SetInsertPoint(CI->getParent(), CI); You can just use: Builder.SetInsertPoint(CI); > + > + Builder.CreateCall3(NewFn, CI->getArgOperand(0), CI->getArgOperand(1), > + CI->getArgOperand(2)); > + > + CallInst *AdjustCall = Builder.CreateCall(AdjustTrampolineFn, > + CI->getArgOperand(0), > +...
2011 Aug 29
3
[LLVMdev] [PATCH] Split init.trampoline into init.trampoline & adjust.trampoline
Hi! Attached patches split init.trampoline into adjust.trampoline and init.trampoline, like in gcc. As mentioned in the previous mail, I've not made a documentation patch, since I'm not sure about what the documented semantics of llvm.adjust.trampoline should be. Thanks! -- Sanjoy Das http://playingwithpointers.com -------------- next part -------------- A non-text attachment was