search for: globalvalue

Displaying 20 results from an estimated 654 matches for "globalvalue".

2016 Nov 19
2
GlobalValue::AvailableExternallyLinkage
Hi, could anybody explain what GlobalValue::AvailableExternallyLinkage means? I implemented an instrumentation pass that creates a clone of a function. For some programs I noticed that also function such as “atoi”, “atof”, “__strspn_c2”, etc. they get cloned even if I am not implementing them in the module. I would like to avoid cloning th...
2004 Feb 02
2
[LLVMdev] Bug In Module::getConstantPointerRef ?
...om is a SIGSEGV in my program in the standard library template for red black trees (bits/stl_tree.h). The crash occurs as the result of an LLVM Module method, getConstantPointerRef which looks like: // Accessor for the underlying GlobalValRefMap... ConstantPointerRef *Module::getConstantPointerRef(GlobalValue *V){ // Create ref map lazily on demand... if (GVRefMap == 0) GVRefMap = new GlobalValueRefMap(); GlobalValueRefMap::iterator I = GVRef...
2014 Aug 21
3
[LLVMdev] How to tell whether a GlobalValue is user-defined
Is there a way to distinguish between GlobalValues that are user-defined and those that are compiler-defined? I am looking for a function that I can use to tell if a GlobalValue is user-defined , something like "GlobalValue::isUserDefined", which returns true for user-defined GlobalValue. I'm trying to make changes to prevent llvm f...
2016 Oct 25
4
RFC: Absolute or "fixed address" symbols as immediate operands
...y value loaded from it. Its presence on a GlobalObject would also imply that the address of the GlobalObject is "fixed" at link time. > > Going back to IR-level representation: here is an alternative representation based on a suggestion from Eli. > > Introduce a new type of GlobalValue called GlobalConstant. GlobalConstant would fit into the GlobalValue hierarchy like this: > GlobalValue > GlobalConstant > GlobalPointer > GlobalIndirectSymbol > GlobalAlias > GlobalIFunc > GlobalObject > Function > GlobalVariable > GlobalValue would no longer be assum...
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* has isExternal set to true? The Gl...
2016 Sep 24
2
RFC: ConstantData should not have use-lists
...read across an >> LLVMContext, most code that looks at the users is wrong. Adding an >> assertion should catch a lot of bugs (see r263853 and r263875) and >> avoid some expensive walks through uninteresting code. >> >> (The same is not true of Constant, generally. A GlobalValue's use-list >> will local to the GlobalValue's Module. Any ConstantVector, >> ConstantArray, or ConstantStruct that points at a GlobalValue will also >> be local to the same Module. In these cases, we also need RAUW >> support.) >> >> Besides catching b...
2009 Oct 14
2
[LLVMdev] GlobalValue.h:116 error
When I attempt to follow any tutorial for llvm and add the `llvm-config --cxxflags --ldflags --libs all` line to my GXX_FLAGS, g++ chokes on llvm/GlobalValue.h, complaining of an invalid cast from int to llvm::GlobalValue::LinkageTypes. I receive this error under both Red Hat and Ubuntu and the version of G++ I am using is 4.1.2. Thanks in advance, Jared -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llv...
2016 Sep 24
4
RFC: ConstantData should not have use-lists
...egal. Since the users of ConstantData are spread across an LLVMContext, most code that looks at the users is wrong. Adding an assertion should catch a lot of bugs (see r263853 and r263875) and avoid some expensive walks through uninteresting code. (The same is not true of Constant, generally. A GlobalValue's use-list will local to the GlobalValue's Module. Any ConstantVector, ConstantArray, or ConstantStruct that points at a GlobalValue will also be local to the same Module. In these cases, we also need RAUW support.) Besides catching bugs, removing use-lists from ConstantData will guarant...
2010 May 16
1
[LLVMdev] How to access the return value of a CallInst
...0000007aad58 7 opt 0x00000000007aae33 llvm::CastInst::Create(llvm::Instruction::CastOps, llvm::Value*, llvm::Type const*, llvm::Twine const&, llvm::Instruction*) + 211 8 opt 0x00000000004f4695 llvm::RSProfilers_std::InstrumentLoadStoreInBlock(llvm::BasicBlock*, llvm::GlobalValue*, llvm::GlobalValue*, llvm::GlobalValue*, llvm::GlobalValue*, llvm::GlobalValue*, llvm::GlobalValue*) + 4101 9 opt 0x00000000004ecb3f 10 opt 0x00000000007d5140 llvm::MPPassManager::runOnModule(llvm::Module&) + 464 11 opt 0x00000000007d76b5 llvm::PassManag...
2016 Nov 19
4
GlobalValue::AvailableExternallyLinkage
...ThreadSanitizer instrumentation pass only on the new copy of the functions, i.e. only the “_parallel” functions will be instrumented by tsan. In some programs that I am compiling, the functions such as atoi and atof get cloned but I want to avoid this, and I noticed that only those functions have GlobalValue::AvailableExternallyLinkage, so I was wondering if checking the linkage is enough to avoid those library functions or there could be situations of functions with that linkage but that have the body implemented in the same module. Does it make sense now? Thanks. Simone > On Nov 19, 2016, at 1...
2016 Oct 24
3
RFC: Absolute or "fixed address" symbols as immediate operands
...ed from it. Its presence on a GlobalObject would also imply > that the address of the GlobalObject is "fixed" at link time. > > Going back to IR-level representation: here is an alternative > representation based on a suggestion from Eli. > > Introduce a new type of GlobalValue called GlobalConstant. > GlobalConstant would fit into the GlobalValue hierarchy like this: > > * GlobalValue > o GlobalConstant > o GlobalPointer > + GlobalIndirectSymbol > # GlobalAlias > # GlobalIFunc > + G...
2016 Nov 19
2
GlobalValue::AvailableExternallyLinkage
...nstrumentation pass only on the new copy of the functions, i.e. only the “_parallel” functions will be instrumented by tsan. >> >> In some programs that I am compiling, the functions such as atoi and atof get cloned but I want to avoid this, and I noticed that only those functions have GlobalValue::AvailableExternallyLinkage, so I was wondering if checking the linkage is enough to avoid those library functions or there could be situations of functions with that linkage but that have the body implemented in the same module. >> >> Does it make sense now? > > That gives me...
2016 Nov 20
2
GlobalValue::AvailableExternallyLinkage
...ass only on the new copy of the functions, i.e. only the “_parallel” functions will be instrumented by tsan. >>>> >>>> In some programs that I am compiling, the functions such as atoi and atof get cloned but I want to avoid this, and I noticed that only those functions have GlobalValue::AvailableExternallyLinkage, so I was wondering if checking the linkage is enough to avoid those library functions or there could be situations of functions with that linkage but that have the body implemented in the same module. >>>> >>>> Does it make sense now? >>&...
2011 Mar 18
2
[LLVMdev] Text or Data symbol
...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->getSymbol(GV)->getSection().getKind(); But again the se...
2004 Jun 17
0
[LLVMdev] MachineOperand: GlobalAddress vs. ExternalSymbol
...rote: > > 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? I think that it could be reasonable to make this change, but it is also reasonable to keep it named MO_GlobalAddress (the operand is the *address* of the global not it's *value*). The MachineInstr...
2016 Oct 25
3
RFC: Absolute or "fixed address" symbols as immediate operands
...rom it. Its presence on a GlobalObject would also imply that the address of the GlobalObject is "fixed" at link time. >> >> Going back to IR-level representation: here is an alternative representation based on a suggestion from Eli. >> >> Introduce a new type of GlobalValue called GlobalConstant. GlobalConstant would fit into the GlobalValue hierarchy like this: >> GlobalValue >> GlobalConstant >> GlobalPointer >> GlobalIndirectSymbol >> GlobalAlias >> GlobalIFunc >> GlobalObject >> Function >> GlobalVariable >&...
2020 Mar 25
4
Multi-Threading Compilers
...erarchy is: Value - Argument - BasicBlock - InlineAsm (huh, why is that not a constant?) - MetadataAsValue (+ children) - User -- Instruction (+ children) -- Constant --- ConstantData (undef, token none, literals) --- ConstantAggregate (non-literal aggregates) --- BlockAddress --- ConstantExpr --- GlobalValue (+ children) -- Operator (utility / facade, i.e. not real) -- DerivedUser (extension point used by MemorySSA) It seems to me that the only points of this hierarchy that are guaranteed to be function-local are Argument and Instruction. Everything else could end up having uses from multiple function...
2011 Mar 21
0
[LLVMdev] Text or Data symbol
I reply to myself... I didn't go in the right direction in my previous email. There is an easy way to tell if a GlobalValue corresponds to data or code: const GlobalValue *GV; if(Function::classof(GV)) ... // process the global value as a function else ... // process the global value as data Damien On Fri, Mar 18, 2011 at 3:16 PM, Damien Vincent <damien.llvm at gmail.com>wrote: > > I am again ca...
2011 Mar 21
1
[LLVMdev] Text or Data symbol
On 3/21/11 2:00 PM, Damien Vincent wrote: > I reply to myself... I didn't go in the right direction in my previous > email. > > There is an easy way to tell if a GlobalValue corresponds to data or code: > const GlobalValue *GV; > if(Function::classof(GV)) > ... // process the global value as a function > else > ... // process the global value as data > > Damien You should be able to use isa<Function>(GV) to determine if GV is a funct...
2015 Dec 11
4
trouble hoisting GlobalValues
Hello LLVM, To reduce the code-size cost of relocations, I'm trying to hoist GlobalValues that are used many times. A new pass hides each hoisted GV behind a BITCAST in the dominating BB. The pass then updates users with the output of the BITCAST. This pass works properly AFAICT. The problems come in instruction selection. SelectionDAGBuilder::visitBitCast() treats the BITCAST as a...