search for: getglobal

Displaying 20 results from an estimated 43 matches for "getglobal".

Did you mean: setglobal
2011 Mar 18
2
[LLVMdev] Text or Data symbol
...LLVM developers ;) For my DSP backend, at the lowering stage and also at the AsmPrinter stage, I need to know if a GlobalAddress is a code or a data address. So I tried at the lowering stage to use: GlobalAddressSDNode *GSDN = cast<GlobalAddressSDNode>(Op); const GlobalValue *GV = GSDN->getGlobal(); GV->hasSection() and GV->getSection() But the section is not set at this stage (hasSection = false) And at the AsmPrinter stage: const GlobalValue *GV = MO.getGlobal(); SectionKind sectionKind = Mang->getSymbol(GV)->getSection().getKind(); But again the section does not seem to be...
2011 Mar 21
0
[LLVMdev] Text or Data symbol
...my DSP backend, at the lowering stage and also at the AsmPrinter stage, > I need to know if a GlobalAddress is a code or a data address. > > So I tried at the lowering stage to use: > GlobalAddressSDNode *GSDN = cast<GlobalAddressSDNode>(Op); > const GlobalValue *GV = GSDN->getGlobal(); > GV->hasSection() and GV->getSection() > But the section is not set at this stage (hasSection = false) > > And at the AsmPrinter stage: > const GlobalValue *GV = MO.getGlobal(); > SectionKind sectionKind = Mang->getSymbol(GV)->getSection().getKind(); > But aga...
2011 Mar 21
1
[LLVMdev] Text or Data symbol
...owering stage and also at the > AsmPrinter stage, I need to know if a GlobalAddress is a code or a > data address. > > So I tried at the lowering stage to use: > GlobalAddressSDNode *GSDN = cast<GlobalAddressSDNode>(Op); > const GlobalValue *GV = GSDN->getGlobal(); > GV->hasSection() and GV->getSection() > But the section is not set at this stage (hasSection = false) > > And at the AsmPrinter stage: > const GlobalValue *GV = MO.getGlobal(); > SectionKind sectionKind = Mang->getSymbol(GV)->getSection().get...
2017 Jun 04
2
[newbie] trouble with global variables and CreateLoad/Store in JIT
Emitting calls to these functions (written in an .ll file linked in) works fine, and does the right thing. %Any = type { i8*, i32 } define dllexport void @setGlobal(%Any* %ptr, %Any %value) { store %Any %value, %Any* %ptr ret void } define dllexport %Any @getGlobal(%Any* %ptr) { %val = load %Any, %Any* %ptr ret %Any %val } Trying to replace the setGlobal call with what should be equivalent builder.CreateStore(value, ptr) results in what should end up in the second (i32) slot being stored in the first (i8*). I've added ::dump() calls where the Crea...
2008 Jan 03
2
[LLVMdev] Tailcall optimization in jit stopped working
...ess()) { - bool NeedStub = !IsStatic || + bool NeedStub = Opcode == X86::TAILJMPd || Opcode == X86::TAILJMPr || + Opcode == X86::TAILJMPm || !IsStatic || (Is64BitMode && TM.getCodeModel() == CodeModel::Large); emitGlobalAddress(MO.getGlobal(), X86::reloc_pcrel_word, 0, 0, NeedStub);
2002 Nov 25
3
[LLVMdev] globals in DS graph
...Snode for g in alloc_func is different from that of > > free_func and NEITHER of them had GlobalNode bit set in their types. Only > > the malloc bit and the incomplete bit have been set. I am completely > > clueless how to figure out if it is a global node or not. I used > > getGlobals and found that the returned map had size 0. > > There may be a few different things going on here. First of all, the > "globals" graph is only partially implemented currently. Right now, nodes > eligable to be moved to the globals graph are properly removed from the > i...
2009 Jun 10
3
[LLVMdev] Why does the x86-64 JIT emit stubs for external calls?
...functions may be outside the Small codespace. bool NeedStub = (Is64BitMode && (TM.getCodeModel() == CodeModel::Large || TM.getSubtarget<X86Subtarget>().isTargetDarwin())) || Opcode == X86::TAILJMPd; emitGlobalAddress(MO.getGlobal(), X86::reloc_pcrel_word, MO.getOffset(), 0, NeedStub); This causes every external call to be emitted as a call to a stub which then jumps to the real function. I understand, thanks to the helpful folks on #llvm, that calls across more than 31 bits of address space need t...
2009 Apr 28
1
[LLVMdev] AddressSpace of a GlobalAddress
Every GlobalAddress has a GlobalValue, Every GlobalValue is a PointerType, Every PointerType has an AddressSpace. So is it ok to add a method getAddressSpace in GlobalAddressSDNode class itself? Currently we have to do GSDN->getGlobal()->getType()->getAddressSpace(). - Sanjiv
2013 Apr 29
2
[LLVMdev] IR from Callee Dag Node
Is there a way to find the IR that corresponds to a callee DAG node? In other words to get the function definition, attributes, etc.? Tia. Reed
2013 Apr 29
0
[LLVMdev] IR from Callee Dag Node
On 04/28/2013 09:49 PM, reed kotler wrote: > Is there a way to find the IR that corresponds to a callee DAG node? > > In other words to get the function definition, attributes, etc.? > > Tia. > > Reed It looks like you can do this by: 1) getParent will return the Module that some global value is in 2) in Module, getFunction will return the function
2015 Jul 01
2
[LLVMdev] Obtaining a GlobalVariable from an MDNode
I’m trying to debug SAFECode source code files, and I need to find a way to obtain a GlobalVariable from its appropriate MDNode. How can I do this? I’ve been looking over the doxygen and I can’t seem to find a way to do this. Thanks, Peter Finn
2002 Dec 06
1
[LLVMdev] WRT: function pointers + DSG
...What do I pass into the DSG in order to access the globals vector of functions that a function pointer may be calling. The code: CallInst *calli = dynamic_cast<CallInst*>(*i); std::vector<GlobalValue*> funcVect = theGraph.getNodeForValue(calli->getCalledFunction()).getNode()->getGlobals(); Doesn't appear to work... getCalledFunction() returns 0 Dave On Fri, 6 Dec 2002, Vikram Adve wrote: > P.S. I have also updated the CSIL tree. Just check out > TarjanSCCIterator.h. > > --Vikram > http://www.cs.uiuc.edu/~vadve > > > > From: David Crowe <d...
2006 Nov 15
2
[LLVMdev] LowerCALL (TargetLowering)
...rand(3))->getValue() != 0; SDOperand Callee = Op.getOperand(4); MVT::ValueType RetVT= Op.Val->getValueType(0); unsigned NumOps = (Op.getNumOperands() - 5) / 2; std::string Name; if (GlobalAddressSDNode *G = dyn_cast<GlobalAddressSDNode>(Callee)) Name = G->getGlobal()->getName(); else if (ExternalSymbolSDNode *S = dyn_cast<ExternalSymbolSDNode>(Callee)) Name = S->getSymbol(); unsigned opcode = funcname_to_opc[Name]; assert(opcode != 0 && "Unknown function call."); std::vector<MVT::ValueType> Tys; std::...
2002 Nov 24
4
[LLVMdev] globals in DS graph
...; free_func(); } I noticed that the DSnode for g in alloc_func is different from that of free_func and NEITHER of them had GlobalNode bit set in their types. Only the malloc bit and the incomplete bit have been set. I am completely clueless how to figure out if it is a global node or not. I used getGlobals and found that the returned map had size 0. How can I get the "common" global node of g?
2002 Nov 25
0
[LLVMdev] globals in DS graph
...ructure.cpp and recompiled the llvm. But still I have the same scenario. I don't get the same DSnode for global. I tried several methods; but none of them were successful. I used the getNodeForValue and again I found that the global value had different nodes in different functions. However, the getGlobals worked well for function call. Thanks, Ganesh On Mon, 25 Nov 2002, Vikram Adve wrote: > Ganesh, > > I modified DataStructure.cpp so that global nodes are no longer > removed from any graphs. Only that file has changed. > > Chris, if you get a chance to do this, it would be nic...
2009 Jun 11
0
[LLVMdev] Why does the x86-64 JIT emit stubs for external calls?
...mall > codespace. > bool NeedStub = > (Is64BitMode && > (TM.getCodeModel() == CodeModel::Large || > TM.getSubtarget<X86Subtarget>().isTargetDarwin())) || > Opcode == X86::TAILJMPd; > emitGlobalAddress(MO.getGlobal(), X86::reloc_pcrel_word, > MO.getOffset(), 0, NeedStub); > > This causes every external call to be emitted as a call to a stub > which then jumps to the real function. > I understand, thanks to the helpful folks on #llvm, that calls across > more than 31...
2007 Jun 29
0
[LLVMdev] How to call native functions from bytecode run in JIT?
...ge!"' Right? But on OS X you don't have this messsage? Here's a temporary fix until I find time to investigate on this: In function PPCISelLowering::LowerCALL, comment the lines: if (GlobalAddressSDNode *G = dyn_cast<GlobalAddressSDNode>(Callee)) Callee = DAG.getTargetGlobalAddress(G->getGlobal(), Callee.getValueType()); This will force an indirect call, and won't use the jump-size limitation of the bl instruction. Let me know if this helps. Cheers, Nicolas Jan Rehders wrote: > Hi, > > attached is a small testcase I did. It builds two LLVM functio...
2008 Feb 15
1
[LLVMdev] LLVM2.2 x64 JIT trouble on VStudio build
...direct calls to dllimported functions in // non-JIT mode. // it get's into here if ((IsTailCall || !Is64Bit || // both these are false getTargetMachine().getCodeModel() != CodeModel::Large) // this is false && !Subtarget->GVRequiresExtraLoad(G->getGlobal(), // this is short circuited away getTargetMachine(), true)) Callee = DAG.getTargetGlobalAddress(G->getGlobal(), getPointerTy()); // this is passed over because the test is false // since it made it through the if (Global...., it skips...
2004 Jun 17
2
[LLVMdev] MachineOperand: GlobalAddress vs. ExternalSymbol
Hi, here I am again with "why is this so" kind of a question. Among different types of MachineOperand there are MO_ExternalSymbol and MO_GlobalAddress. For MO_GlobalAddress, we can get usefull information from the getGlobal() method, which returns GlobalValue*. Wouldn'it it be better is MO_GlobalAddress be called MO_GlobalValue, for consistency? Second, MO_ExternalSymbol is used for storing name of external variable/function, right? Why it's not possible to use MO_GlobalAddress, where returned GlobalValue...
2009 Apr 20
0
[LLVMdev] A few questions from a newbie
...I am learning to write a new backend for LLVM and have a few > simple questions. Hi Peter, I am a newbie too, but I have recently dealt with the same issues. > 1) What are the differences between 'constant' and 'targetconstant', > 'globaladdress' and 'targetglobaladdress'? It is not clear from the > document when and which should be used. The target* variants are 'done' and will not be changed further by the instruction selection. After instruction selection, everything should be converted to the target* variants. > 2) On the proces...