Open aeubanks opened 1 year ago
Are you sure this is created by LowerTypeTests and not WPD? I see the typeid...*_unique_member alias being created here by WPD: https://github.com/llvm-mirror/llvm/blob/master/lib/Transforms/IPO/WholeProgramDevirt.cpp#L1343
Looks like this kind of alias is only created with the hybrid ThinLTO+Regular LTO WPD that comes with enabling ThinLTO + WPD but not disabling module splitting. Specifically this looks like it is related to unique return value optimization. I'm not as familiar with these optimizations - @pcc can you comment on what semantics are intended here?
Should this instead look like: @typeidZTS20ZeroCopyOutputStream_8_unique_member = hidden alias i8, getelementptr (i8, ptr @0, i64 16)
(i.e. if the GV being used in the aliasee expression is itself a weak alias, use its base object instead)?
__typeid__ZTS20ZeroCopyOutputStream_8_unique_member
(hidden alias to _ZTV16FileOutputStream
) is created in WPD, but LTT changes _ZTV16FileOutputStream
from a weak_odr
constant to a weak_odr
alias to a private constant.
@llvm/issue-subscribers-backend-x86
This is from https://reviews.llvm.org/D145208.
zero_copy_stream.h
:main.cc
:impl_lite.cc
:coded_stream.cc
:after LowerTypeTests in
ld-temp.o
, you'll seeI'm still struggling to understand aliases and weak symbols, but as mentioned in https://reviews.llvm.org/D145208 apparently this is an edge case that doesn't have well defined semantics. With some upstream changes, this broke Windows with undefined symbol errors (although this repro is on Linux for ease of debugging, I can give the Windows repro as well if you'd like).
@pcc @teresajohnson