llvm-project/llvm
Sanjay Patel e79b43a01f [x86] generalize reassociation optimization in machine combiner to 2 instructions
Currently ( D10321, http://reviews.llvm.org/rL239486 ), we can use the machine combiner pass
to reassociate the following sequence to reduce the critical path:

A = ? op ?
B = A op X
C = B op Y
-->
A = ? op ?
B = X op Y
C = A op B

'op' is currently limited to x86 AVX scalar FP adds (with fast-math on), but in theory, it could
be any associative math/logic op (see TODO in code comment).

This patch generalizes the pattern match to ignore the instruction that defines 'A'. So instead of
a sequence of 3 adds, we now only need to find 2 dependent adds and decide if it's worth
reassociating them.

This generalization has a compile-time cost because we can now match more instruction sequences
and we rely more heavily on the machine combiner to discard sequences where reassociation doesn't
improve the critical path.

For example, in the new test case:

A = M div N
B = A add X
C = B add Y

We'll match 2 reassociation patterns, but this transform doesn't reduce the critical path:

A = M div N
B = A add Y
C = B add X

We need the combiner to reject that pattern but select this:

A = M div N
B = X add Y
C = B add A

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

llvm-svn: 240361
2015-06-23 00:39:40 +00:00
..
autoconf [autoconf] Detect OLE32 for mingw. 2015-06-18 04:16:05 +00:00
bindings Update LLVM bindings after r239940. Apparently these aren't included in 2015-06-18 11:51:16 +00:00
cmake Support Solaris unused sections' gc link syntax. 2015-06-22 15:06:17 +00:00
docs docs: Update allowed values for LLVM_USE_SANITIZER 2015-06-22 18:55:46 +00:00
examples BrainF.cpp: Update CreateCall() according to r237624. 2015-05-19 06:50:19 +00:00
include Re-apply "InstrProf: When reading, copy the data instead of taking a reference. NFC" 2015-06-22 23:58:05 +00:00
lib [x86] generalize reassociation optimization in machine combiner to 2 instructions 2015-06-23 00:39:40 +00:00
projects build: make libunwind a proper project 2015-04-25 01:47:39 +00:00
resources In MSVC builds embed a VERSIONINFO resource in our exe and DLL files. 2015-06-12 15:58:29 +00:00
test [x86] generalize reassociation optimization in machine combiner to 2 instructions 2015-06-23 00:39:40 +00:00
tools [CMake] Treating LLVM_INCLUDE_TOOLS, which is a bool, as a string to change behaviors of the build is a dirty hack. We shouldn't do it. 2015-06-22 21:58:02 +00:00
unittests InstrProf: Add a test for multiple copies of the same with different hashes 2015-06-22 23:56:53 +00:00
utils test-release.sh: Minor fixes. 2015-06-22 21:13:30 +00:00
.arcconfig
.clang-format
.clang-tidy
.gitignore
CMakeLists.txt Do not pass -allow-shlib-undefined to the Solaris linker. 2015-06-22 18:24:01 +00:00
CODE_OWNERS.TXT Added Andrey Churbanov as the owner of the OpenMP runtime library code 2015-05-05 20:17:53 +00:00
CREDITS.TXT
LICENSE.TXT
LLVMBuild.txt
Makefile
Makefile.common
Makefile.config.in Deprecate in-source autotools builds 2015-05-04 02:04:54 +00:00
Makefile.rules
README.txt
configure [autoconf] Detect OLE32 for mingw. 2015-06-18 04:16:05 +00:00
llvm.spec.in

README.txt

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.