search for: linkonce_odr

Displaying 20 results from an estimated 280 matches for "linkonce_odr".

2018 Feb 07
0
ThinLTO and linkonce_odr + unnamed_addr
There should be no semantic difference between linkonce_odr and weak_odr, except that weak_odr is non-discardable. Why doesn't the autohide optimization work just as well on weak_odr + unnamed_addr as linkonce_odr + unnamed_addr? On Tue, Feb 6, 2018 at 5:35 PM, Steven Wu via llvm-dev < llvm-dev at lists.llvm.org> wrote: > Hi, > > I rece...
2018 Feb 07
7
ThinLTO and linkonce_odr + unnamed_addr
Hi, I recently found that thinLTO doesn't deal with globals that has linkonce_odr and unnamed_addr (for macho at least) because it prohibits the autohide optimization during link time. In LLVM, we tagged a global linkonce_odr and unnamed_addr to indicate to the linker can hide them from symbol table if they were picked (aka, linkonce_odr_auto_hide linkage). It is very commonly...
2018 Feb 08
0
ThinLTO and linkonce_odr + unnamed_addr
...t;: >> >> >>> On Feb 7, 2018, at 12:36 PM, Mehdi AMINI <joker.eph at gmail.com <mailto:joker.eph at gmail.com>> wrote: >>> >>> > But it is interesting in general because according to the definition for local_unnamed_addr, the symbol has to be linkonce_odr to be auto hide as well. ThinLTO promotion can break that as well. >>> >>> What do you mean that the promotion can break that? >>> >>> The original description I found here: https://reviews.llvm.org/D20348 <https://reviews.llvm.org/D20348> says that it is...
2018 Feb 08
3
ThinLTO and linkonce_odr + unnamed_addr
...0 Steven Wu <stevenwu at apple.com>: > >> >> >> On Feb 7, 2018, at 12:36 PM, Mehdi AMINI <joker.eph at gmail.com> wrote: >> >> > But it is interesting in general because according to the definition >> for local_unnamed_addr, the symbol has to be linkonce_odr to be auto hide >> as well. ThinLTO promotion can break that as well. >> >> What do you mean that the promotion can break that? >> >> The original description I found here: https://reviews.llvm.org/D20348 >> says that it is possible to exclude a global from the s...
2018 Feb 08
2
ThinLTO and linkonce_odr + unnamed_addr
...apple.com>: >> >>> >>> >>> On Feb 7, 2018, at 12:36 PM, Mehdi AMINI <joker.eph at gmail.com> wrote: >>> >>> > But it is interesting in general because according to the definition >>> for local_unnamed_addr, the symbol has to be linkonce_odr to be auto hide >>> as well. ThinLTO promotion can break that as well. >>> >>> What do you mean that the promotion can break that? >>> >>> The original description I found here: https://reviews.llvm.org/D20348 says >>> that it is possible to exc...
2018 Feb 09
3
ThinLTO and linkonce_odr + unnamed_addr
I wonder whether we could change the frontend to always give hidden visibility to globals which are linkonce_odr unnamed_addr. That way, the mechanism would just work in ELF as well and would not require LTO. Peter On Fri, Feb 9, 2018 at 10:46 AM, Steven Wu via llvm-dev < llvm-dev at lists.llvm.org> wrote: > The one that doesn’t require global analysis is commit in r324757. > > The global an...
2016 Jun 01
2
linkonce_odr & coff
I have @_rtti_a_a = linkonce_odr constant in two files that end up as coff object files. Shoudln't the linkonce_odr prevent duplicate symbol: __rtti_a_a \consoleapplication149.o and __rtti_a_a island.lib(island.o) from happening in LLD? If not what alternative can I use? THis is used for template like generics, so having...
2018 Feb 08
1
ThinLTO and linkonce_odr + unnamed_addr
...apple.com>: >> >>> >>> >>> On Feb 7, 2018, at 12:36 PM, Mehdi AMINI <joker.eph at gmail.com> wrote: >>> >>> > But it is interesting in general because according to the definition >>> for local_unnamed_addr, the symbol has to be linkonce_odr to be auto hide >>> as well. ThinLTO promotion can break that as well. >>> >>> What do you mean that the promotion can break that? >>> >>> The original description I found here: https://reviews.llvm.org/D20348 says >>> that it is possible to exc...
2018 Feb 09
2
ThinLTO and linkonce_odr + unnamed_addr
...>>>> >>>> >>>> On Feb 7, 2018, at 12:36 PM, Mehdi AMINI <joker.eph at gmail.com> wrote: >>>> >>>> > But it is interesting in general because according to the definition >>>> for local_unnamed_addr, the symbol has to be linkonce_odr to be auto hide >>>> as well. ThinLTO promotion can break that as well. >>>> >>>> What do you mean that the promotion can break that? >>>> >>>> The original description I found here: https://reviews.llvm.org/D20348 says >>>> th...
2018 Feb 09
0
ThinLTO and linkonce_odr + unnamed_addr
...t;>> >>>> On Feb 7, 2018, at 12:36 PM, Mehdi AMINI <joker.eph at gmail.com <mailto:joker.eph at gmail.com>> wrote: >>>> >>>> > But it is interesting in general because according to the definition for local_unnamed_addr, the symbol has to be linkonce_odr to be auto hide as well. ThinLTO promotion can break that as well. >>>> >>>> What do you mean that the promotion can break that? >>>> >>>> The original description I found here: https://reviews.llvm.org/D20348 <https://reviews.llvm.org/D20348>...
2018 Feb 07
3
ThinLTO and linkonce_odr + unnamed_addr
...now. The optimization is defined include/llvm/Analysis/ObjectUtils.h. If I enable that for weak_odr + unnamed_addr, no tests are failing so I guess it is a safe optimization? :) It is probably because the autohide optimization is targeted at c++ templates and inline functions and we know they have linkonce_odr linkage, which suggests whoever uses this symbol should have their own copy. Because the linkonce_odr is safe to drop so it is safe to assume that nothing else should be relying on the symbol to be available from the current linkage unit, so it is safe to hide from symbol table. weak_odr is often u...
2018 Feb 09
2
ThinLTO and linkonce_odr + unnamed_addr
Steven Wu <stevenwu at apple.com> writes: > Add Rafael here. Because he basically ask me the same question in my commit. > > I wonder why clang choose to do unnamed_addr instead of just do visibility hidden. If linkonce_odr + unnamed_addr is just hidden, is the only difference linkonce_odr + unnamed_addr not in the symbol table? A local symbol being in the symbol table is mostly an implementation detail. Not marking a linkonce_odr + *global* unnamed_addr hidden is a missing optimization on non-MachO. Cheers, Rafael
2018 Feb 09
0
ThinLTO and linkonce_odr + unnamed_addr
Add Rafael here. Because he basically ask me the same question in my commit. I wonder why clang choose to do unnamed_addr instead of just do visibility hidden. If linkonce_odr + unnamed_addr is just hidden, is the only difference linkonce_odr + unnamed_addr not in the symbol table? Steven > On Feb 9, 2018, at 10:50 AM, Peter Collingbourne <peter at pcc.me.uk> wrote: > > I wonder whether we could change the frontend to always give hidden visibility to gl...
2018 Feb 09
0
ThinLTO and linkonce_odr + unnamed_addr
...>>>>> On Feb 7, 2018, at 12:36 PM, Mehdi AMINI <joker.eph at gmail.com <mailto:joker.eph at gmail.com>> wrote: >>>>> >>>>> > But it is interesting in general because according to the definition for local_unnamed_addr, the symbol has to be linkonce_odr to be auto hide as well. ThinLTO promotion can break that as well. >>>>> >>>>> What do you mean that the promotion can break that? >>>>> >>>>> The original description I found here: https://reviews.llvm.org/D20348 <https://reviews.llv...
2018 Feb 07
0
ThinLTO and linkonce_odr + unnamed_addr
...defined include/llvm/Analysis/ObjectUtils.h. If I enable that for > weak_odr + unnamed_addr, no tests are failing so I guess it is a safe > optimization? :) > > It is probably because the autohide optimization is targeted at c++ > templates and inline functions and we know they have linkonce_odr linkage, > which suggests whoever uses this symbol should have their own copy. Because > the linkonce_odr is safe to drop so it is safe to assume that nothing else > should be relying on the symbol to be available from the current linkage > unit, so it is safe to hide from symbol table....
2018 Feb 08
2
ThinLTO and linkonce_odr + unnamed_addr
2018-02-07 12:45 GMT-08:00 Steven Wu <stevenwu at apple.com>: > > > On Feb 7, 2018, at 12:36 PM, Mehdi AMINI <joker.eph at gmail.com> wrote: > > > But it is interesting in general because according to the definition > for local_unnamed_addr, the symbol has to be linkonce_odr to be auto hide > as well. ThinLTO promotion can break that as well. > > What do you mean that the promotion can break that? > > The original description I found here: https://reviews.llvm.org/D20348 > says that it is possible to exclude a global from the symbol table if > thre...
2018 Feb 07
2
ThinLTO and linkonce_odr + unnamed_addr
> But it is interesting in general because according to the definition for local_unnamed_addr, the symbol has to be linkonce_odr to be auto hide as well. ThinLTO promotion can break that as well. What do you mean that the promotion can break that? The original description I found here: https://reviews.llvm.org/D20348 says that it is possible to exclude a global from the symbol table if three things are true: - This att...
2018 Feb 08
0
ThinLTO and linkonce_odr + unnamed_addr
...u at apple.com>>: > > >> On Feb 7, 2018, at 12:36 PM, Mehdi AMINI <joker.eph at gmail.com <mailto:joker.eph at gmail.com>> wrote: >> >> > But it is interesting in general because according to the definition for local_unnamed_addr, the symbol has to be linkonce_odr to be auto hide as well. ThinLTO promotion can break that as well. >> >> What do you mean that the promotion can break that? >> >> The original description I found here: https://reviews.llvm.org/D20348 <https://reviews.llvm.org/D20348> says that it is possible to exc...
2018 Feb 07
0
ThinLTO and linkonce_odr + unnamed_addr
> On Feb 7, 2018, at 12:36 PM, Mehdi AMINI <joker.eph at gmail.com> wrote: > > > But it is interesting in general because according to the definition for local_unnamed_addr, the symbol has to be linkonce_odr to be auto hide as well. ThinLTO promotion can break that as well. > > What do you mean that the promotion can break that? > > The original description I found here: https://reviews.llvm.org/D20348 <https://reviews.llvm.org/D20348> says that it is possible to exclude a global fr...
2018 Feb 07
0
ThinLTO and linkonce_odr + unnamed_addr
...internal linkage to external due to importing. I'm not an expert on how this would affect link semantics. Thanks, Teresa On Tue, Feb 6, 2018 at 5:35 PM, Steven Wu <stevenwu at apple.com> wrote: > Hi, > > I recently found that thinLTO doesn't deal with globals that has > linkonce_odr and unnamed_addr (for macho at least) because it prohibits the > autohide optimization during link time. > > In LLVM, we tagged a global linkonce_odr and unnamed_addr to indicate to > the linker can hide them from symbol table if they were picked (aka, > linkonce_odr_auto_hide linkag...