search for: globalalia

Displaying 20 results from an estimated 81 matches for "globalalia".

Did you mean: globalalias
2011 Mar 21
1
[LLVMdev] Text or Data symbol
...nction::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 function. You may have to put in an additional check to see if GV is a GlobalAlias and to determine if the GlobalAlias is an alias for a function: if (GlobalAlias * GA = dyn_cast<GlobalAlias>(GV)) { ... Check to see if GA is an alias for a function } I recommend looking at the doxygen documentation on llvm.org to learn the class hierarchy relationships between Glob...
2020 Sep 10
2
[IR] Modelling of GlobalIFunc
> * Calling getBaseObject() on a GlobalIFunc returns its resolver function. I still don't understand how it can happen looking to the code ( https://github.com/llvm/llvm-project/blob/master/llvm/lib/IR/Globals.cpp#L430). I believe it should return nullptr (the same as if you call it from GlobalAlias that refers to GlobalIFunc). I don't have a strong opinion here because deriving GlobalIFunc from GlobalObject does make some sense. At the same time from implementation point of view there were lots of similarities between GlobalAlias and GlobalIFunc (in the most case they should be handled...
2014 Oct 02
2
[LLVMdev] LTOModule::parseSymbols not handling GlobalAlias
Hello everyone, ...I should have used a different subject line in the first place... I've asked Rafael a question about GlobalAlias handling in LTOModule::parseSymbols, but he seems to be on vacation... Does anyone knows the answer? Thanks a lot! Sergei --- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation > -----Original Message----- > From: llvmdev-bounces at cs.u...
2020 Sep 07
3
[IR] Modelling of GlobalIFunc
...upon a design limitation or perhaps a potential mis-modelling of GlobalIFunc in the IR object hierarchy, which leads to some problems in LTO flows. To summarize, as it currently stands (and in the hopes of faithfully representing the conclusions of that discussion): * Calling getBaseObject() on a GlobalAlias whose aliasee is a GlobalIFunc currently returns null. * Calling getBaseObject() on a GlobalIFunc returns its resolver function. * This causes computeAliasSummary in ModuleSummaryAnalysis to crash on a null dereference for an alias-to-ifunc situation. * A GlobalIFunc and its resolver are *not* int...
2014 Mar 21
3
[LLVMdev] lli crashes when running cpp programs
...ne/JIT/JITEmitter.cpp ------------------------ void *JITEmitter::getPointerToGlobal(GlobalValue *V, void *Reference, bool MayNeedFarStub) { if (GlobalVariable *GV = dyn_cast<GlobalVariable>(V)) return TheJIT->getOrEmitGlobalVariable(GV); if (GlobalAlias *GA = dyn_cast<GlobalAlias>(V)) return TheJIT->getPointerToGlobal(GA->resolveAliasedGlobal(false)); One possible solution is to let JITEmitter emit a stub for the name like following: @@ -687,8 +687,19 @@ if (GlobalVariable *GV = dyn_cast<GlobalVariable>(V)) ret...
2013 Oct 30
0
[LLVMdev] [RFC] Alias should not point to declarations
...implement weakref directly in clang, with the > same logic an assembler uses to implement .weakref (which is what gcc > prints). This makes sense to me, but I'm not an expert on ELF aliases. If you're working in this area, there is something that has been bugging me for years about GlobalAlias: because we require the type of the alias and aliasee to match, we have to allow constant exprs in the aliasee (see GlobalAlias::getAliasedGlobal). This representation is bad for several reasons. I think it would be much better to change GlobalAlias to allow the aliasee to have a different type...
2013 Oct 30
1
[LLVMdev] [RFC] Alias should not point to declarations
...y in clang, with the >> same logic an assembler uses to implement .weakref (which is what gcc >> prints). > > This makes sense to me, but I'm not an expert on ELF aliases. > > If you're working in this area, there is something that has been bugging me for years about GlobalAlias: because we require the type of the alias and aliasee to match, we have to allow constant exprs in the aliasee (see GlobalAlias::getAliasedGlobal). > > This representation is bad for several reasons. I think it would be much better to change GlobalAlias to allow the aliasee to have a differ...
2011 Jun 17
3
[LLVMdev] can GlobalAlias point to a middle of a structure?
...ias @Extern that points to the middle element of this struct. The compilation passes, but the resulting object looks like this: 000000000060d150 B Extern 000000000060d150 B Extern_asan_redzone I.e. @Extern points to the beginning of @Extern_asan_redzone instead of middle. Also, the comment in GlobalAlias.h says: /// getAliasedGlobal() - Aliasee can be either global or bitcast of /// global. This method retrives the global for both aliasee flavours. So, the question: can I get an alias pointing to the middle of a GlobalVariable? How? If not, is there some other way to create a left redzone f...
2014 May 23
2
[LLVMdev] Changing the design of GlobalAliases to represent what is actually possible in object files.
...need to * Be able to create labels with an absolute value. * Be able to create labels inside a GlobalVarible or pointing to the start of a GlobalVariable or Function. Note that it is still just a label. No relocations are involved. The tool we have in llvm for creating these extra labels is the GlobalAlias. One way of representing the above uses is to be explicit: a label is created with a specific value or at an offset from another. Another way of representing it is with a ConstantExpr, since those two cases are a subset of what a ConstantExpr can represent. My preference is for having an explic...
2011 Jun 17
0
[LLVMdev] can GlobalAlias point to a middle of a structure?
Hi Kostya, > In order to find out-of-bound accesses to global objects with AddressSanitizer > (http://code.google.com/p/address-sanitizer/wiki/AddressSanitizer) > I need to create redzones to the left and to the right of every global variable. > > I tried the following: > Before: > @Extern = global [10 x i8] zeroinitializer, align 1 > After: > %0 = type { [32 x
2009 Aug 25
1
[LLVMdev] RFC: Supporting ELF symbol aliases via GlobalAlias GEPs
...ses > hard-code this (e.g. ".type " + name + ", @object") when emitting global > variables.  I've implemented this for X86ATTAsmWPrinter, and will add the > same for other classes as required. > > - PrintGlobalOffsetAlias(), also in AsmPrinter.  This outputs a GlobalAlias > which is a GEP to a GlobalVariable, if the target supports it. > > This is a proof-of-concept implementation which, pending review, I'd like to > commit as a work-in-progress and then work on adding support for more > targets.  It should be relatively trivial to add this for o...
2009 Aug 25
0
[LLVMdev] RFC: Supporting ELF symbol aliases via GlobalAlias GEPs
...l of the subclasses hard-code this (e.g. ".type " + name + ", @object") when emitting global variables. I've implemented this for X86ATTAsmWPrinter, and will add the same for other classes as required. - PrintGlobalOffsetAlias(), also in AsmPrinter. This outputs a GlobalAlias which is a GEP to a GlobalVariable, if the target supports it. This is a proof-of-concept implementation which, pending review, I'd like to commit as a work-in-progress and then work on adding support for more targets. It should be relatively trivial to add this for other ELF targets...
2014 May 05
2
[LLVMdev] [RFC] Section Declarations in LLVM IR
Just a heads up, I'm planning on sending patches for this soon. -- David Majnemer On Tue, Apr 1, 2014 at 2:23 PM, Rafael Espíndola <rafael.espindola at gmail.com > wrote: > > I like this proposal. Any reason to use an explicit offset rather than > > allow GEPs into aliases? > > Part of pr10367. A contant gep is more generic than whan an alias can > actually
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
2009 Aug 23
3
[LLVMdev] RFC: Supporting ELF symbol aliases via GlobalAlias GEPs
Hi Everyone, Chris suggested[1] I should ask for feedback as to whether this is a desired feature before I put too much effort into it, so here goes: I would like to be able to export a symbol that is inside an LLVM structure. This is possible on ELF targets[2], and the attached proof- of-concept patch to AsmWriter makes it work (although in a hackish way that I am NOT suggesting be
2016 Oct 25
3
RFC: Absolute or "fixed address" symbols as immediate operands
...hat I think we need to decide on here is a representation for declarations. From that, I think our representation for definitions should be clear. For example, I think that if we decide to require GlobalConstant to have a pointer type, it may be reasonable to use it only for declarations and to use GlobalAlias for definitions. This I think would be analogous to the current state where a GlobalAlias can be referenced by either a Function or a GlobalVariable. Thanks, -- -- Peter -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/...
2016 Oct 25
4
RFC: Absolute or "fixed address" symbols as immediate operands
...tion: 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 assumed to be of pointer type. The getType() overload that takes a PointerType, as well as getValueType() would be moved down to GlobalPointer. (A nice side benefit of this is that it would hel...
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
2013 Oct 30
4
[LLVMdev] [RFC] Alias should not point to declarations
A long time ago (before r97733) we used to model the weakref attribute by outputting a new declaration and a weak alias to it. This was fairly buggy and we now implement weakref directly in clang, with the same logic an assembler uses to implement .weakref (which is what gcc prints). One thing that was left from that old implementation is that we still have alias to declarations and they are a
2010 Jun 21
0
[LLVMdev] getGlobalContext()
...obalVariable>::createSentinel() { GlobalVariable *Ret = new GlobalVariable(Type::getInt32Ty(getGlobalContext()), false, GlobalValue::ExternalLinkage); // This should not be garbage monitored. LeakDetector::removeGarbageObject(Ret); return Ret; } GlobalAlias *ilist_traits<GlobalAlias>::createSentinel() { GlobalAlias *Ret = new GlobalAlias(Type::getInt32Ty(getGlobalContext()), GlobalValue::ExternalLinkage); // This should not be garbage monitored. LeakDetector::removeGarbageObject(Ret); return Ret; }