1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 02:52:53 +02:00
llvm-mirror/lib
Teresa Johnson c649b1f9bb [ThinLTO] Fix handling of weak interposable symbols
Summary:
Keep aliasees alive if their alias is live, otherwise we end up with an
alias to a declaration, which is invalid. This can happen when the
aliasee is weak and non-prevailing.

This fix exposed the fact that we were then attempting to internalize
the weak symbol, which was not exported as it was not prevailing. We
should not internalize interposable symbols in general, unless this is
the prevailing copy, since it can lead to incorrect inlining and other
optimizations. Most of the changes in this patch are due to the
restructuring required to pass down the prevailing callback.

Finally, while implementing the test cases, I found that in the case of
a weak aliasee that is still marked not live because its alias isn't
live, after dropping the definition we incorrectly marked the
declaration with weak linkage when resolving prevailing symbols in the
module. This was due to some special case handling for symbols marked
WeakLinkage in the summary located before instead of after a subsequent
check for the symbol being a declaration. It turns out that we don't
actually need this special case handling any more (looking back at the
history, when that was added the code was structured quite differently)
- we will correctly mark with weak linkage further below when the
definition hasn't been dropped.

Fixes PR42542.

Reviewers: pcc

Subscribers: mehdi_amini, inglorion, steven_wu, dexonsmith, dang, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D66264

llvm-svn: 369766
2019-08-23 15:18:58 +00:00
..
Analysis [MustExec] Add a generic "must-be-executed-context" explorer 2019-08-23 15:17:27 +00:00
AsmParser [llvm] Migrate llvm::make_unique to std::make_unique 2019-08-15 15:54:37 +00:00
BinaryFormat [BinaryFormat] Teach identify_magic about Tapi files. 2019-08-21 21:00:16 +00:00
Bitcode [BitcodeReader] Check if we can create a null constant for type. 2019-08-21 18:20:11 +00:00
Bitstream
CodeGen [DAGCombine] GetNegatedExpression - add FMA\FMAD support 2019-08-23 10:49:46 +00:00
DebugInfo Add FileWriter to GSYM and encode/decode functions to AddressRange and AddressRanges 2019-08-21 21:48:11 +00:00
Demangle
ExecutionEngine [cmake] Link in LLVMPasses due to dependency by LLVMOrcJIT; NFC 2019-08-19 23:12:48 +00:00
Fuzzer
FuzzMutate [llvm] Migrate llvm::make_unique to std::make_unique 2019-08-15 15:54:37 +00:00
IR IR. Change strip* family of functions to not look through aliases. 2019-08-22 19:56:14 +00:00
IRReader
LineEditor
Linker Linker: Add support for GlobalIFunc. 2019-08-08 22:09:18 +00:00
LTO [ThinLTO] Fix handling of weak interposable symbols 2019-08-23 15:18:58 +00:00
MC [PowerPC][XCOFF][MC] Explicitly set containing csect on symbols. [NFC] 2019-08-22 15:11:23 +00:00
MCA [MCA] consistently use MCPhysReg instead of unsigned as register type. NFCI 2019-08-22 13:32:17 +00:00
Object [Object] FIX: update PlatformKind name in TapiFile 2019-08-21 23:57:57 +00:00
ObjectYAML [yaml2obj] - Allow setting the symbol st_other field to any integer. 2019-08-23 09:31:07 +00:00
Option [llvm] Migrate llvm::make_unique to std::make_unique 2019-08-15 15:54:37 +00:00
Passes [LoopPassManager + MemorySSA] Only enable use of MemorySSA for LPMs known to preserve it. 2019-08-21 17:00:57 +00:00
ProfileData [AutoFDO] Make call targets order deterministic for sample profile 2019-08-20 20:52:00 +00:00
Remarks [llvm] Migrate llvm::make_unique to std::make_unique 2019-08-15 15:54:37 +00:00
Support [Support] Improve readNativeFile(Slice) interface 2019-08-22 08:13:30 +00:00
TableGen [llvm] Migrate llvm::make_unique to std::make_unique 2019-08-15 15:54:37 +00:00
Target [mips] Reduce number of instructions used for loading a global symbol's value 2019-08-23 13:36:24 +00:00
Testing
TextAPI [TextAPI] Update reader to be supported by lib/Object 2019-08-16 15:30:48 +00:00
ToolDrivers [llvm-dlltool] Make sure to strip decorations from ExtName for renamed exports 2019-08-23 11:18:11 +00:00
Transforms [ThinLTO] Fix handling of weak interposable symbols 2019-08-23 15:18:58 +00:00
WindowsManifest Fight a bit against global initializers. NFC. 2019-08-22 19:43:27 +00:00
XRay [llvm] Migrate llvm::make_unique to std::make_unique 2019-08-15 15:54:37 +00:00
CMakeLists.txt Fix build errors LLVM tests are disabled. 2019-07-11 22:08:35 +00:00
LLVMBuild.txt