1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 11:02:59 +02:00
Go to file
Chandler Carruth 4a66ec34bd Re-implement the analysis of uses in mem2reg to be significantly more
robust. It now uses an InstVisitor and worklist to actually walk the
uses of the Alloca transitively and detect the pattern which we can
directly promote: loads & stores of the whole alloca and instructions we
can completely ignore.

Also, with this new implementation teach both the predicate for testing
whether we can promote and the promotion engine itself to use the same
code so we no longer have strange divergence between the two code paths.

I've added some silly test cases to demonstrate that we can handle
slightly more degenerate code patterns now. See the below for why this
is even interesting.

Performance impact: roughly 1% regression in the performance of SROA or
ScalarRepl on a large C++-ish test case where most of the allocas are
basically ready for promotion. The reason is because of silly redundant
work that I've left FIXMEs for and which I'll address in the next
commit. I wanted to separate this commit as it changes the behavior.
Once the redundant work in removing the dead uses of the alloca is
fixed, this code appears to be faster than the old version. =]

So why is this useful? Because the previous requirement for promotion
required a *specific* visit pattern of the uses of the alloca to verify:
we *had* to look for no more than 1 intervening use. The end goal is to
have SROA automatically detect when an alloca is already promotable and
directly hand it to the mem2reg machinery rather than trying to
partition and rewrite it. This is a 25% or more performance improvement
for SROA, and a significant chunk of the delta between it and
ScalarRepl. To get there, we need to make mem2reg actually capable of
promoting allocas which *look* promotable to SROA without have SROA do
tons of work to massage the code into just the right form.

This is actually the tip of the iceberg. There are tremendous potential
savings we can realize here by de-duplicating work between mem2reg and
SROA.

llvm-svn: 187191
2013-07-26 08:20:39 +00:00
autoconf [PowerPC] Support powerpc64le as a syntax-checking target. 2013-07-26 01:35:43 +00:00
bindings We're in 3.4 land now. 2013-05-07 20:31:28 +00:00
cmake Tweak the cmake interaction between CMAKE_BUILD_TYPE and LLVM_ENABLE_ASSERTIONS. 2013-07-17 09:34:51 +00:00
docs Phabricator.rst: tiny fix 2013-07-25 22:58:31 +00:00
examples Adding example source to support MCJIT/Kaleidoscope blog posts. 2013-07-22 18:47:24 +00:00
include Make .bc en/decoding of AttrKind stable 2013-07-26 04:16:55 +00:00
lib Re-implement the analysis of uses in mem2reg to be significantly more 2013-07-26 08:20:39 +00:00
projects [PowerPC] Support powerpc64le as a syntax-checking target. 2013-07-26 01:35:43 +00:00
runtime Remove dead code from the makefile build system. 2013-07-25 20:25:31 +00:00
test Re-implement the analysis of uses in mem2reg to be significantly more 2013-07-26 08:20:39 +00:00
tools Remove the mblaze backend from llvm. 2013-07-25 18:55:05 +00:00
unittests Don't end a file name with a dot. It looks odd. 2013-07-25 15:00:17 +00:00
utils Using a different loop induction variable than the enclosing scope. No functional changes intended. 2013-07-25 22:09:31 +00:00
.arcconfig Add .arcconfig to the repository. Useful if someone wants to use phabricator's command line tool. 2012-12-01 12:07:58 +00:00
.gitignore Add extra vim swap file pattern 2012-10-09 23:48:34 +00:00
CMakeLists.txt Remove the mblaze backend from llvm. 2013-07-25 18:55:05 +00:00
CODE_OWNERS.TXT Add more owners to CODE_OWNERS.TXT (Kostya Serebryany: AddressSanitizer and ThreadSanitizer; Evgeniy Stepanov: MemorySanitizer) 2013-06-27 08:47:12 +00:00
configure Remove the mblaze backend from llvm. 2013-07-25 18:55:05 +00:00
CREDITS.TXT Identify me on IRC. 2013-06-18 22:09:36 +00:00
LICENSE.TXT Be more specific and capitalize filenames. 2013-05-21 21:22:34 +00:00
llvm.spec.in Tidy up. s/Low Level Virtual Machine/LLVM/. 2012-01-25 22:00:23 +00:00
LLVMBuild.txt LLVMBuild: Introduce a common section which currently has a list of the 2011-12-12 22:45:54 +00:00
Makefile Fix regular expression used by 'make update' to only look for 'I' and '?' at the start of svn info results and to check for spaces after 'I' instead of just after '?'. 2013-07-03 14:48:37 +00:00
Makefile.common Makefile.common: Update a description, s/Source/SOURCES/ , according to MakefileGuide.html#control-variables . 2012-12-07 01:43:23 +00:00
Makefile.config.in Add an autoconf option for turning on -gsplit-dwarf by default 2013-06-25 01:12:25 +00:00
Makefile.rules Remove dead code from the makefile build system. 2013-07-25 20:25:31 +00:00
README.txt test 2013-04-17 05:34:03 +00:00

Low Level Virtual Machine (LLVM)
================================

This directory and its subdirectories contain source code for the Low Level
Virtual Machine, 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're writing a package for LLVM, see docs/Packaging.rst for our
suggestions.