llvm/test
Bruno Cardoso Lopes 6969fd1c60 [PeepholeOptimizer] Look through PHIs to find additional register sources
Reapply 243271 with more fixes; although we are not handling multiple
sources with coalescable copies, we were not properly skipping this
case.

- 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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243486 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-28 21:45:50 +00:00
..
Analysis [SCEV] Apply NSW and NUW flags via poison value analysis 2015-07-28 18:22:40 +00:00
Assembler DI/Verifier: Fix argument bitrot in DILocalVariable 2015-07-24 23:59:25 +00:00
Bindings
Bitcode
BugPoint Fix typo in comment 2015-07-26 11:37:05 +00:00
CodeGen [PeepholeOptimizer] Look through PHIs to find additional register sources 2015-07-28 21:45:50 +00:00
DebugInfo Implement target independent TLS compatible with glibc's emutls.c. 2015-07-28 16:24:05 +00:00
ExecutionEngine [RuntimeDyld] MachO: Add support for ARM scattered vanilla relocations. 2015-07-24 17:40:04 +00:00
Feature
FileCheck
Instrumentation [asan] Rename the ABI versioning symbol to '__asan_version_mismatch_check' instead of abusing '__asan_init' 2015-07-23 10:54:06 +00:00
Integer
JitListener
LibDriver
Linker
LTO
MC AVX512: Add encoding tests to vptestnm instructions 2015-07-28 07:00:00 +00:00
Object Support printing relocations in files with no section table. 2015-07-23 09:11:05 +00:00
Other
SymbolRewriter
TableGen
tools [llvm-mc] Add --no-warn flag with -W alias to disable outputting warnings while assembling. 2015-07-27 22:39:14 +00:00
Transforms [SCEV] Apply NSW and NUW flags via poison value analysis 2015-07-28 18:22:40 +00:00
Unit
Verifier
YAMLParser
.clang-format
CMakeLists.txt
lit.cfg
lit.site.cfg.in
Makefile
Makefile.tests
TestRunner.sh