llvm-6502/lib
Bill Schmidt a5a5a62fff [PPC64LE] Teach swap optimization about the doubleword splat idiom
With a previous patch, the VSX swap optimization is able to recognize
the doubleword load-splat idiom that can be implemented using lxvdsx.
However, that does not cover a doubleword splat where the source is a
register.  We can implement this using xxspltd (a special form of
xxpermdi).  This patch teaches the swap optimization pass about this
idiom.

As a prerequisite, it also permits swap optimization to succeed for
all forms of SUBREG_TO_REG.  Previously we were conservative and only
allowed SUBREG_TO_REG when it copied a full register.  However, on
reflection any form of SUBREG_TO_REG is safe in and of itself, so long
as an unsafe operation is not performed on its result.  In particular,
a widening SUBREG_TO_REG often occurs as an input to a doubleword
splat idiom, particularly in auto-vectorized code.

The doubleword splat idiom is an XXPERMDI operation where both source
registers are identical, and the selection mask is either 0 (splat the
first element) or 3 (splat the second element).  To determine whether
the registers are identical, we use the existing mechanism for looking
through "copy-like" operations.  That mechanism has a side effect of
marking the XXPERMDI operation as using a physical register, which
would invalidate its presence in a swap-optimized region.  This is
correct for the form of XXPERMDI that performs a swap and hence would
be removed, but is not what we want for a doubleword-splat variety of
XXPERMDI.  Therefore we reset the physical-register flag on the
XXPERMDI when it represents a splat.

A simple test case is added to verify that we generate the splat and
that we also remove the xxswapd instructions that would otherwise be
associated with the load and store of another operand.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241285 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-02 17:03:06 +00:00
..
Analysis Delete whitespace at start of line. 2015-07-02 14:17:12 +00:00
AsmParser
Bitcode Fix for PR23310: llvm-dis crashes when trying to upgrade an intrinsic. 2015-07-02 16:22:40 +00:00
CodeGen Reapply r240291: Fix shl folding in DAG combiner. 2015-07-02 11:44:54 +00:00
DebugInfo
ExecutionEngine Use ErrorOr in getRelocationAdress. 2015-06-30 20:32:26 +00:00
Fuzzer
IR Fix a fixme and make DICompileUnit a distinct node. Tested via clang. 2015-06-30 18:32:18 +00:00
IRReader
LibDriver
LineEditor
Linker
LTO
MC Convert a member variable to a local one. 2015-07-02 16:59:57 +00:00
Object Return ErrorOr from getSection. 2015-07-01 12:56:27 +00:00
Option
Passes
ProfileData
Support [Support] Lazy load of dbghlp.dll on Windows 2015-07-02 14:34:57 +00:00
TableGen
Target [PPC64LE] Teach swap optimization about the doubleword splat idiom 2015-07-02 17:03:06 +00:00
Transforms Remove whitespace from start of line, NFC. 2015-07-02 14:25:09 +00:00
CMakeLists.txt
LLVMBuild.txt
Makefile