LLVM backend for 6502
Go to file
Sanjay Patel 959b276771 transform fadd chains to increase parallelism
This is a compromise: with this simple patch, we should always handle a chain of exactly 3
operations optimally, but we're not generating the optimal balanced binary tree for a longer
sequence.

In general, this transform will reduce the dependency chain for a sequence of instructions
using N operands from a worst case N-1 dependent operations to N/2 dependent operations. 
The optimal balanced binary tree would reduce the chain to log2(N).

The trade-off for not dealing with longer sequences is: (1) we have less complexity in the
compiler, (2) we avoid unknown compile-time blowup calculating a balanced tree, and (3) we
don't need to worry about the increased register pressure required to parallelize longer
sequences. It also seems unlikely that we would ever encounter really long strings of
dependent ops like that in the wild, but I'm not sure how to verify that speculation.
FWIW, I see no perf difference for test-suite running on btver2 (x86-64) with -ffast-math
and this patch.

We can extend this patch to cover other associative operations such as fmul, fmax, fmin, 
integer add, integer mul.

This is a partial fix for:
https://llvm.org/bugs/show_bug.cgi?id=17305

and if extended:
https://llvm.org/bugs/show_bug.cgi?id=21768
https://llvm.org/bugs/show_bug.cgi?id=23116

The issue also came up in:
http://reviews.llvm.org/D8941

Differential Revision: http://reviews.llvm.org/D9232



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236031 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-28 21:03:22 +00:00
autoconf Try to unbreak Clang build to export LLVM_ABI_BREAKING_CHECKS, fixup for r233310. 2015-04-01 11:46:15 +00:00
bindings DebugInfo: Remove DIArray and DITypeArray typedefs 2015-04-21 20:07:38 +00:00
cmake Allow building the gold plugin even if the gold binary is not found. 2015-04-27 21:08:47 +00:00
docs [docs] Fix the link to SanitizerCoverage docs. 2015-04-27 22:50:06 +00:00
examples [Kaleidoscope] Fix incorrect use of reinterpret_cast. 2015-04-22 20:58:34 +00:00
include move IR-level optimization flags into their own struct 2015-04-28 16:39:12 +00:00
lib transform fadd chains to increase parallelism 2015-04-28 21:03:22 +00:00
projects build: make libunwind a proper project 2015-04-25 01:47:39 +00:00
test transform fadd chains to increase parallelism 2015-04-28 21:03:22 +00:00
tools LTO: Add API to choose whether to embed uselists 2015-04-27 23:38:54 +00:00
unittests Make getModRefInfo(Instruction *) not crash on certain types of instructions 2015-04-28 19:19:14 +00:00
utils [TableGen] Don't leak Expanders and Operators in SetTheory. 2015-04-24 06:49:44 +00:00
.arcconfig Updated phabricator server. 2014-04-07 03:57:04 +00:00
.clang-format Test commit. 2014-03-02 13:08:46 +00:00
.clang-tidy Enable display of compiler diagnostics in clang-tidy by default. 2014-10-29 17:29:38 +00:00
.gitignore Ignore compile_commands.json only at the root of the tree. 2015-03-26 18:55:42 +00:00
CMakeLists.txt [CMake] Updates to llvm-shlib to support overriding exports list and added an option to export all symbols. 2015-04-13 21:29:46 +00:00
CODE_OWNERS.TXT Add myself as the Constant Folder owner. 2015-04-20 23:19:10 +00:00
configure Try to unbreak Clang build to export LLVM_ABI_BREAKING_CHECKS, fixup for r233310. 2015-04-01 11:46:15 +00:00
CREDITS.TXT Rise from the dead and update personal info 2014-08-25 17:51:04 +00:00
LICENSE.TXT Update for a new year. 2015-03-12 01:25:29 +00:00
llvm.spec.in
LLVMBuild.txt Remove the very substantial, largely unmaintained legacy PGO 2013-10-02 15:42:23 +00:00
Makefile [configure/make] Propagate names of build host tools when making BuildTools 2014-03-25 21:45:41 +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 Try to unbreak Clang build to export LLVM_ABI_BREAKING_CHECKS, fixup for r233310. 2015-04-01 11:46:15 +00:00
Makefile.rules Add support for SunOS function/data sections and associated 2015-03-03 20:54:29 +00:00
README.txt Revert test commit at revision 233535. 2015-03-30 12:39:03 +00:00

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

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're writing a package for LLVM, see docs/Packaging.rst for our
suggestions.