search for: setlinkag

Displaying 20 results from an estimated 38 matches for "setlinkag".

Did you mean: setlinkage
2009 Nov 05
3
[LLVMdev] create dummy function
...? I think it just need some quick attention with getting materials up to date. In the end I got following code, that satisfy my needs: llvm::Constant* c = M.getOrInsertFunction(dummyFunctionName, F.getFunctionType()); llvm::Function* dummy = llvm::cast<llvm::Function>(c); dummy->setLinkage(llvm::Function::ExternalLinkage); dummy->setCallingConv(llvm::CallingConv::C); llvm::BasicBlock* block = llvm::BasicBlock::Create("entry", dummy); // no context needed llvm::IRBuilder builder(block); // no need in <> builder.CreateRetVoid(); Cheers, Oleg. 2009/11/5...
2012 Apr 08
1
[LLVMdev] Privatize global variables
Hi John, > The -internalize pass changes globals to have internal linkage. Does this > not suffice for your needs? To my understanding, it does not. The -internalize pass performs: I->setLinkage(GlobalValue::InternalLinkage); which means it only changes the linkage mode, while global variables remain in place. And we need to *replace* globals with local variables in main and arguments - in other functions. - D. 2012/4/8 John Criswell <criswell at illinois.edu>: > On 4/7/12 7:2...
2007 Apr 06
1
[LLVMdev] Integrating LLVM in an existing project
...row. (2) - FuncCPPPersonality = cast<Function>( + FuncCPPPersonality = TheModule->getOrInsertFunction("__gxx_personality_v0", Type::getPrimitiveType(Type::VoidTyID), - NULL)); - FuncCPPPersonality->setLinkage(Function::ExternalLinkage); - FuncCPPPersonality->setCallingConv(CallingConv::C); + NULL); - FuncUnwindResume = cast<Function>( + FuncUnwindResume = TheModule->getOrInsertFunction("_Unwind_Resume",...
2007 Apr 06
0
[LLVMdev] Integrating LLVM in an existing project
On Fri, 6 Apr 2007, Nicolas Geoffray wrote: > Like you say, it's not functional for non-calls instructions. Besides, > having to change all CalInst to InvokeInst is just too much pain in our > current vm. ok. > Actually, why is it missing? What's the difference between the code > generator and the JIT? There are two things missing: 1. Testing and working out the set
2020 Jun 03
2
Fwd: I cannot change value of global variable in LLVM IR using IRBuilder
...IRBuilder<> Builder(M.getContext()); Instruction *I = &*inst_begin(M.getFunction("main")); Builder.SetInsertPoint(I); M.getOrInsertGlobal("globalKey", Builder.getInt64Ty()); GlobalVariable* gVar = M.getNamedGlobal("globalKey"); gVar->setLinkage(GlobalValue::InternalLinkage); gVar->setAlignment(Align(8)); gVar->setInitializer(Builder.getInt64(0)); gVar->setConstant(false); for (Function &F : M.functions()) { InstructionVisitor visitor(DL, getAnalysis<TargetLibraryInfoWrapperPass>().getTLI(F));...
2009 Nov 15
0
[LLVMdev] create dummy function
...ttention with getting materials up to date. > > In the end I got following code, that satisfy my needs: > > llvm::Constant* c = M.getOrInsertFunction(dummyFunctionName, > F.getFunctionType()); > llvm::Function* dummy = llvm::cast<llvm::Function>(c); > dummy->setLinkage(llvm::Function::ExternalLinkage); > dummy->setCallingConv(llvm::CallingConv::C); > llvm::BasicBlock* block = llvm::BasicBlock::Create("entry", dummy); > // no context needed > llvm::IRBuilder builder(block); // no need in <> > builder.CreateRetVoid();...
2007 Apr 06
2
[LLVMdev] Integrating LLVM in an existing project
Hi Chris, Chris Lattner wrote: >> We can not use current exception handling in llvm, see >> http://www.nondot.org/sabre/LLVMNotes/ExceptionHandlingChanges.txt. >> > > Why not? > > Like you say, it's not functional for non-calls instructions. Besides, having to change all CalInst to InvokeInst is just too much pain in our current vm. > There are two
2015 Jun 04
5
[LLVMdev] Removing AvailableExternal values in GlobalDCE (was Re: RFC: ThinLTO Impementation Plan)
On Thu, Jun 4, 2015 at 3:58 PM, Duncan P. N. Exon Smith < dexonsmith at apple.com> wrote: > > > Personally, I think the right approach is to add a bool to > createGlobalDCEPass defaulting to true named something like > IsAfterInlining. In most standard pass pipelines, GlobalDCE runs after > inlining for obvious reasons, so the default makes sense. The special case > is
2018 Feb 02
2
Debug info error on bitcode inline modification
...; Instruction *inst = &*I; CallInst::Create(callee, "", inst); } if (F->getName() == "callee") { F->setLinkage(GlobalValue::InternalLinkage); F->addFnAttr(Attribute::AlwaysInline); F->addFnAttr(Attribute::InlineHint); } } } std::error_code ec; raw_fd_ostream os(argv[1], ec,...
2020 Jun 03
2
Fwd: I cannot change value of global variable in LLVM IR using IRBuilder
...> Instruction *I = &*inst_begin(M.getFunction("main")); > > Builder.SetInsertPoint(I); > > M.getOrInsertGlobal("globalKey", Builder.getInt64Ty()); > > GlobalVariable* gVar = M.getNamedGlobal("globalKey"); > > gVar->setLinkage(GlobalValue::InternalLinkage); > > gVar->setAlignment(Align(8)); > > gVar->setInitializer(Builder.getInt64(0)); > > gVar->setConstant(false); > > > > for (Function &F : M.functions()) { > > InstructionVisitor visitor(DL, getA...
2018 Dec 13
2
Setting a function in a module to extern
But in my module this function already exist… I first want to delete it but without also deleting the calls to it… From: Boldizsar.Palotas at esa.int <Boldizsar.Palotas at esa.int> Sent: Donnerstag, 13. Dezember 2018 10:53 To: Gaier, Bjoern <Bjoern.Gaier at horiba.com> Cc: LLVM Developers Mailing List <llvm-dev at lists.llvm.org> Subject: Re: [llvm-dev] Setting a function in a
2011 Feb 22
2
[LLVMdev] Clone a function and change signature
...ansform to call this new function, and to take a new argument. The code I added was as follows CI->getCalledFunction()->dump(); Function* DirectF = CloneFunction(CI->getCalledFunction()); DirectF->setName(CI->getCalledFunction()->getNameStr() + "_SPEC"); DirectF->setLinkage(GlobalValue::InternalLinkage); // add the extra argument new Argument(GEP->getPointerOperand()->getType(),"arg",DirectF); M.getFunctionList().push_back(DirectF); DirectF->dump(); SmallVector<Value*, 8> Args; for(unsigned j =1;j<CI->getNumOperands();j++) {...
2018 Feb 02
0
Debug info error on bitcode inline modification
...Instruction *inst = &*I; > > CallInst::Create(callee, "", inst); > } > > if (F->getName() == "callee") > { > > F->setLinkage(GlobalValue::InternalLinkage); > F->addFnAttr(Attribute::AlwaysInline); > F->addFnAttr(Attribute::InlineHint); > } > } > } > > std::error_code ec; >...
2011 Mar 06
2
[LLVMdev] how to zero-init a global
Hi! I have a module containing a constant e.g. @input = global %0 zeroinitializer, align 16 when I copy the global into another module I use newGlobal->copyAttributesFrom(global); but the new module now has @input = external global %0, align 16 i.e. the zeroinitializer is missing. how do I set it or copy it from the other global? -Jochen
2011 Mar 06
0
[LLVMdev] how to zero-init a global
...at, as I mentioned in response to your earlier question, not all constants are safe to use in a different module. So simply copying the initializer may be unsafe... Note that linkage and constness don't seem to count either. newGlobal->setConstant(global->isConstant()); newGlobal->setLinkage(global->getLinkage()); All three of these can also be passed to the constructor for newGlobal, by the way. According to the comment on GlobalValue::copyAttributesFrom() (as well as its GlobalVariable override) this seems to be the defining characteristic that qualifies them as "attributes...
2012 Apr 08
0
[LLVMdev] Privatize global variables
On 4/7/12 7:28 PM, Dmitry N. Mikushin wrote: > Dear LLVM, > > To workaround the GPU modules visibility rules, we need to lower > global variables into scope-variables of main entry and arguments in > other functions. For example, The -internalize pass changes globals to have internal linkage. Does this not suffice for your needs? -- John T. > > int foo = 0; > > int
2009 Oct 22
1
[LLVMdev] need to access static functions as extern
Hello, I write some instrumentation which needs to call static function from other files. Is there a way to associate a global name/alias to a static function? I need to turn the assembly code .align 16 .type some_static.2467, at function some_static.2467: CODE into .align 16 .type some_static.2467, at function some_static.2467: .align 16
2015 Aug 12
2
Proposal/patch: simple parallel LTO code generation
Hi all, The most time consuming part of LTO at opt level 1 is by far the backend code generator. (As a reminder, LTO opt level 1 runs a minimal set of passes; it is most useful where the motivation behind the use of LTO is to deploy a transformation that requires whole program visibility such as control flow integrity [1], rather than to optimise the program using whole program visibility). Code
2009 Nov 05
0
[LLVMdev] create dummy function
2009/11/5 Oleg Knut <oleg77 at gmail.com>: > Hello, > I have a simple question. How to create "dummy" function which will > have no functionality behind (return nothing and do nothing)? > Currently I'm trying to do this: > > llvm::Constant* c = Module.getOrInsertFunction("dummy", > FunctionThatNeedsToBeReplaced.getFunctionType()); >
2012 Apr 08
2
[LLVMdev] Privatize global variables
Dear LLVM, To workaround the GPU modules visibility rules, we need to lower global variables into scope-variables of main entry and arguments in other functions. For example, int foo = 0; int func() { return foo + 1; } int main() { return func(); } should become: int func(int* foo) { return *foo + 1; } int main() { int foo = 0; return func(&foo); } Is there a strong name/term for this