Go to file
Bill Schmidt 7c691fee1c [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.

llvm-svn: 241285
2015-07-02 17:03:06 +00:00
clang Revert "Refactored ARMTargetInfo in order to use the API of llvm/lib/Support/TargetParser.cpp for extracting target specific information." 2015-07-02 15:14:10 +00:00
clang-tools-extra [clang-tidy] Enhance clang-tidy misc-macro-repeated-side-effects... 2015-07-02 07:49:55 +00:00
compiler-rt [sanitizer] add #ifdefs around slow unwinder to fix OS X debug build 2015-07-02 13:56:37 +00:00
debuginfo-tests New round of fixes for "Always compile debuginfo-tests for the host triple" 2014-10-18 23:47:59 +00:00
libclc Properly initialize Module pointer 2015-06-27 12:35:54 +00:00
libcxx Noticed that std::allocator<const T> was missing the definition for is_always_equal. Fixed this, and added a test for it. 2015-07-01 21:23:40 +00:00
libcxxabi fallback_malloc: silence conversion warning (NFC) 2015-06-03 17:25:35 +00:00
libunwind Fix unw_getcontext() return value on AArch64. 2015-06-25 15:12:46 +00:00
lld [ELF] Remove dead code. NFC 2015-07-02 15:04:08 +00:00
lldb Make sure we can lookup re-exported symbols after recent changes to lldb_private::Symbol. 2015-07-02 16:43:49 +00:00
llgo [llgo] cmd/llgoi: use line editor 2015-05-23 15:16:09 +00:00
llvm [PPC64LE] Teach swap optimization about the doubleword splat idiom 2015-07-02 17:03:06 +00:00
openmp Fix OMPT event_barrer_end 2015-07-01 15:16:04 +00:00
polly Update isl to isl-0.15-35-ga1e44f0 2015-07-02 07:59:21 +00:00