hanchenye-llvm-project/llvm
Bruno Cardoso Lopes 27fd06922b [PeepholeOptimizer] Look through PHIs to find additional register sources
Reintroduce r245442. Remove an overly conservative assertion introduced
in r245442. We could replace the assertion to use `shareSameRegisterFile`
instead, but in that point in `insertPHI` we already lost the original
Def subreg to check against. So drop the assertion completely.

Original commit message:

- Teaches the ValueTracker in the PeepholeOptimizer to look through PHI
instructions.
- Add findNextSourceAndRewritePHI method to lookup into multiple sources
returnted by the ValueTracker and rewrite PHIs with new sources.

With these changes we can find more register sources and rewrite more
copies to allow coaslescing of bitcast instructions. Hence, we eliminate
unnecessary VR64 <-> GR64 copies in x86, but it could be extended to
other archs by marking "isBitcast" on target specific instructions. The
x86 example follows:

A:
  psllq %mm1, %mm0
  movd  %mm0, %r9
  jmp C

B:
  por %mm1, %mm0
  movd  %mm0, %r9
  jmp C

C:
  movd  %r9, %mm0
  pshufw  $238, %mm0, %mm0

Becomes:

A:
  psllq %mm1, %mm0
  jmp C

B:
  por %mm1, %mm0
  jmp C

C:
  pshufw  $238, %mm0, %mm0

Differential Revision: http://reviews.llvm.org/D11197
rdar://problem/20404526

llvm-svn: 245479
2015-08-19 18:53:36 +00:00
..
autoconf Add an exposed variable for which c++ compiler we're using for our 2015-08-17 22:46:26 +00:00
bindings [PM/AA] Remove the last relics of the separate IPA library from LLVM, 2015-08-18 17:51:53 +00:00
cmake [cmake] Start adding support for LLVM_USE_SANITIZER=Address on Windows 2015-08-14 16:48:34 +00:00
docs [Kaleidoscope] More inter-chapter diff reduction. 2015-08-19 18:32:58 +00:00
examples [Kaleidoscope] More inter-chapter diff reduction. 2015-08-19 18:32:58 +00:00
include [PeepholeOptimizer] Look through PHIs to find additional register sources 2015-08-19 18:53:36 +00:00
lib [PeepholeOptimizer] Look through PHIs to find additional register sources 2015-08-19 18:53:36 +00:00
projects
resources
test [PeepholeOptimizer] Look through PHIs to find additional register sources 2015-08-19 18:53:36 +00:00
tools [PM/AA] Remove the last relics of the separate IPA library from LLVM, 2015-08-18 17:51:53 +00:00
unittests [PM/AA] Remove the last relics of the separate IPA library from LLVM, 2015-08-18 17:51:53 +00:00
utils Fix three typos in comments; "easilly" -> "easily". 2015-08-18 22:41:58 +00:00
.arcconfig
.clang-format
.clang-tidy
.gitignore Minor updates to gitignore so that symlinks are ignored in the projects dir. 2015-07-07 20:24:58 +00:00
CMakeLists.txt [lit] Don't disable the lit progress bar by default with MSVC 2015-08-11 21:24:59 +00:00
CODE_OWNERS.TXT Add myself as the InstCombine owner. 2015-08-12 22:30:45 +00:00
CREDITS.TXT [WebAssembly] Initial WebAssembly backend 2015-06-29 23:51:55 +00:00
LICENSE.TXT
LLVMBuild.txt
Makefile
Makefile.common
Makefile.config.in We're actually -Wmissing-field-initializers clean thanks to the cmake 2015-08-07 16:44:47 +00:00
Makefile.rules We're actually -Wmissing-field-initializers clean thanks to the cmake 2015-08-07 16:44:47 +00:00
README.txt
configure Add an exposed variable for which c++ compiler we're using for our 2015-08-17 22:46:26 +00:00
llvm.spec.in [Sparc] Implement i64 load/store support for 32-bit sparc. 2015-08-10 19:11:39 +00:00

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.