Old fork of llvm-mirror, used on older RPCS3 builds
Go to file
whitequark 19a9621221 [MergeFuncs] Improve ordering of equal functions
Summary:
MergeFunctions currently tries to process strong functions before
weak functions, because weak functions can simply call strong
functions, while a strong/weak function cannot call a weak function
(a backing strong function is needed).

This patch additionally tries to process external functions before
local functions, because we definitely have to keep the external
function, but may be able to drop the local one (and definitely
can if it is also unnamed_addr).

Unfortunately, this exposes an existing bug in the implementation:
The FnTree and FNodesInTree structures can currently go out of
sync in the case where two weak functions are merged, because the
function in FnTree/FNodesInTree is RAUWed. This leaves it behind in
FnTree (this is intended, as it is the strong backing function which
should be used for further merges), while it is replaced in
FNodesInTree (this is not intended).

This is fixed by switching FNodesInTree from using a ValueMap to
using a DenseMap of AssertingVH.

This exposes another minor issue: Currently FNodesInTree is not
cleared after MergeFunctions finishes running. Currently, this is
potentially dangerous (e.g. if something else wants to RAUW a function
with a non-function), but at the very least it is unnecessary/inefficient.
After the change to use AssertingVH it becomes more problematic,
because there are certainly passes that remove functions.

This issue is fixed by clearing FNodesInTree at the end of the pass.

Reviewers: jfb, whitequark

Reviewed By: whitequark

Subscribers: rkruppe, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346386 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-08 03:58:01 +00:00
benchmarks Pull google/benchmark library to the LLVM tree 2018-08-28 09:42:41 +00:00
bindings [TI removal] Remove TerminatorInst references from bindings. 2018-10-18 07:40:03 +00:00
cmake [CMake] Expose opt-remark tooling through libOptRemarks.dylib 2018-11-05 11:57:44 +00:00
docs AMDGPU/Docs: Add product names for Vega20 2018-11-07 20:54:16 +00:00
examples [BuildingAJIT] Update the Ch1 KaleidoscopeJIT class to expose errors to clients. 2018-10-18 00:51:38 +00:00
include [sancov] Put .SCOV* sections into the right comdat groups on COFF 2018-11-08 00:57:33 +00:00
lib [MergeFuncs] Improve ordering of equal functions 2018-11-08 03:58:01 +00:00
projects [cmake] Support moving debuginfo-tests to llvm/projects 2017-12-12 17:06:08 +00:00
resources
runtimes Revert "[CMake] Pass Clang defaults to runtimes builds" 2018-07-13 20:01:55 +00:00
test [MergeFuncs] Improve ordering of equal functions 2018-11-08 03:58:01 +00:00
tools [llvm-readobj] Implement LLVM style printer for --notes 2018-11-07 23:53:50 +00:00
unittests Extend virtual file system with isLocal method 2018-11-08 00:01:32 +00:00
utils [FileCheck] Parse command-line options from FILECHECK_OPTS 2018-11-06 22:07:03 +00:00
.arcconfig [llvm] Set up .arcconfig to point to Diffusion L repository 2018-01-12 15:37:41 +00:00
.clang-format
.clang-tidy .clang-tidy: correct style name is 'camelBack' not 'lowerCase'. 2016-09-13 19:04:26 +00:00
.gitattributes [DebugInfo] Add DILabel metadata and intrinsic llvm.dbg.label. 2018-05-09 02:40:45 +00:00
.gitignore [git/svn] Ignore Visual Studio's CMakeSettings.json. 2018-10-29 14:51:02 +00:00
CMakeLists.txt Revert "Reorder FindPythonInterp so that config-ix can use PYTHON_EXECUTABLE" 2018-11-08 01:10:24 +00:00
CODE_OWNERS.TXT Add owner for llvm-objcopy 2018-08-09 22:05:19 +00:00
configure Remove autoconf support 2016-01-26 21:29:08 +00:00
CREDITS.TXT It's a test commit, which is my first commit and also add my name to CREDITS.TXT 2018-11-06 03:07:03 +00:00
LICENSE.TXT Update copyright year to 2018. 2018-06-18 12:22:17 +00:00
llvm.spec.in
LLVMBuild.txt
README.txt Test commit. 2018-09-22 01:01:03 +00:00
RELEASE_TESTERS.TXT Remove myself from the release testers list. (NFC) 2018-06-20 21:25:50 +00:00

The LLVM Compiler Infrastructure
================================

This directory and its subdirectories contain source code for LLVM,
a toolkit for the construction of highly optimized compilers,
optimizers, and runtime environments.

LLVM is open source software. You may freely distribute it under the terms of
the license agreement found in LICENSE.txt.

Please see the documentation provided in docs/ for further
assistance with LLVM, and in particular docs/GettingStarted.rst for getting
started with LLVM and docs/README.txt for an overview of LLVM's
documentation setup.

If you are writing a package for LLVM, see docs/Packaging.rst for our
suggestions.