search for: globaladdresssdnode

Displaying 20 results from an estimated 28 matches for "globaladdresssdnode".

2011 Mar 18
2
[LLVMdev] Text or Data symbol
I am again calling for help from 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...
2006 Nov 15
2
[LLVMdev] LowerCALL (TargetLowering)
...assert(!isVarArg); bool isTailCall = cast<ConstantSDNode>(Op.getOperand(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 fu...
2011 Mar 21
0
[LLVMdev] Text or Data symbol
...lvm at gmail.com>wrote: > > I am again calling for help from 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(); &...
2016 Oct 11
2
RFC: Absolute or "fixed address" symbols as immediate operands
...independently of the other changes. > > That said, I don’t understand why you’d keep ConstantSDNode around and > introduce a new derived class of it. This seems like something that a new > “imm" immediate matcher would handle: it would match constants in a certain > range, or a GlobalAddressSDNode known-to-be-small. > To begin with: I'm not sure that GlobalAddressSDNode is the right node to use for these types of immediates. It seems that we have two broad classes of globals here: those with a fixed-at-link-time address (e.g. regular non-PIC symbols, absolute symbols) and those where...
2007 Jun 29
0
[LLVMdev] How to call native functions from bytecode run in JIT?
...t;< 23) && ResultPtr < (1 << 23) && "Relocation out of range!"' 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...
2011 Mar 21
1
[LLVMdev] Text or Data symbol
...gt; > I am again calling for help from 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...
2007 Jun 27
2
[LLVMdev] How to call native functions from bytecode run in JIT?
Hi, attached is a small testcase I did. It builds two LLVM functions which both call two native functions get5 and get6. The native functions are in the exe and in the dll. On OS X it works like a charm. On Linux none of the two functions can be called. Maybe someone can try them or have a look at it to see if there is something obviously wrong greetings, Jan -------------- next part
2006 Nov 15
0
[LLVMdev] LowerCALL (TargetLowering)
...lCall = cast<ConstantSDNode>(Op.getOperand(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]; > ass...
2012 Mar 16
0
[LLVMdev] Lowering formal pointer arguments
I had the same issue as both of you when I was implementing this for my backend. In LowerCall you can get the callee prototype info when the Callee SDValue is a GlobalAddressSDNode doing cast<Function>(G->getGlobal()) (where G is GlobalAddressSDNode *G = dyn_cast<GlobalAddressSDNode>(Callee)), but this won't work when it is a ExternalSymbolSDNode, for that case i had to add additional info into the ISD::OutputArg struct to know the real size of the splitted...
2016 Oct 11
2
RFC: Absolute or "fixed address" symbols as immediate operands
...other changes. >> >> That said, I don’t understand why you’d keep ConstantSDNode around and >> introduce a new derived class of it. This seems like something that a new >> “imm" immediate matcher would handle: it would match constants in a certain >> range, or a GlobalAddressSDNode known-to-be-small. >> > > To begin with: I'm not sure that GlobalAddressSDNode is the right node to > use for these types of immediates. It seems that we have two broad classes > of globals here: those with a fixed-at-link-time address (e.g. regular > non-PIC symbols, absol...
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
2013 Jul 02
1
[LLVMdev] Problem selecting the correct registers for a calling convention
...managed to resolve this same problem by using custom C++ code since as you mentioned the isSplit flag doesn't help here. There are 2 ways to analyze the arguments of a function: 1) You can get a Function pointer in LowerFormalArguments, and in LowerCall only when Callee can by dyn_casted to a GlobalAddressSDNode. By having this pointer you can then do: for (Function::const_arg_iterator I = F->arg_begin(), E = F->arg_end();I != E; ++I) { unsigned Bytes = TD->getTypeSizeInBits(I->getType()) / 8; // do stuff here } 2) The second case is when the dyn_cast above fails because the Cal...
2007 Jun 30
1
[LLVMdev] How to call native functions from bytecode run in JIT?
...evious message for various attempts and their results) I will submit two bug reports when I receive my bugzilla password Greetings, Jan > 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 help...
2006 Nov 15
1
[LLVMdev] LowerCALL (TargetLowering)
...gt;(Op.getOperand(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 =...
2008 Feb 15
1
[LLVMdev] LLVM2.2 x64 JIT trouble on VStudio build
...128 unsigned int Is64Bit true bool HasLow4GUserAddress true bool TargetType isWindows llvm::X86Subtarget::<unnamed-tag> if (GlobalAddressSDNode *G = dyn_cast<GlobalAddressSDNode>(Callee)) { // We should use extra load for direct calls to dllimported functions in // non-JIT mode. // it get's into here if ((IsTailCall || !Is64Bit || // both these are false getTargetMachine().getCodeModel() != CodeMode...
2009 Apr 20
0
[LLVMdev] A few questions from a newbie
...ode<"BfinISD::Wrapper", SDTIntUnaryOp>; Then custom lower ISD::GlobalAddress, converting it to a wrapped TargetGlobalAddress: SDValue BlackfinTargetLowering::LowerGlobalAddress(SDValue Op, SelectionDAG &DAG) { DebugLoc DL = Op.getDebugLoc(); GlobalValue *GV = cast<GlobalAddressSDNode>(Op)->getGlobal(); Op = DAG.getTargetGlobalAddress(GV, MVT::i32); return DAG.getNode(BfinISD::Wrapper, DL, MVT::i32, Op); } Now you can pattern match on the wrapper: def : Pat<(BfinWrapper (i32 tglobaladdr:$addr)), (LOAD32imm tglobaladdr:$addr)>; If you think this i...
2009 Apr 20
2
[LLVMdev] A few questions from a newbie
Hello, I am learning to write a new backend for LLVM and have a few simple questions. 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. 2) On the processor I am working on, there is a 'move reg, mem_addr' instruction. When I try
2016 Oct 11
5
RFC: Absolute or "fixed address" symbols as immediate operands
Hi all, I wanted to summarise some discussion on llvm-commits [0,1] as an RFC, as I felt it demanded wider circulation. Our support for references to absolute symbols is not very good. The symbol will be resolved accurately in non-PIC code, but suboptimally: the symbol reference cannot currently appear as the immediate operand of an instruction, and the code generator cannot make any assumptions