llvm-6502/test
Andrea Di Biagio ac7b9c828f [X86][DAG] Disable target specific combine on INSERTPS dag nodes at -O0.
This patch disables target specific combine on X86ISD::INSERTPS dag nodes
if optlevel is CodeGenOpt::None.

The backend currently implements a target specific combine rule that converts
a vector load used by an INSERTPS dag node into a scalar load plus a
scalar_to_vector. This allows ISel to select a single INSERTPSrm instead of
two instructions (i.e. a vector load plus INSERTPSrr).

However, the existing target combine rule on INSERTPS nodes only works under
the assumption that ISel will always be able to match an INSERTPSrm. This is
not true in general at -O0, since the backend only allows folding a load into
the memory operand of an instruction if the optimization level is not
CodeGenOpt::None.

In the example below:

//
__m128 test(__m128 a, __m128 *b) {
  __m128 c = _mm_insert_ps(a, *b, 1 << 6);
  return c;
}
//

Before this patch, at -O0, the backend would have canonicalized the load to 'b'
into a scalar load plus scalar_to_vector. Later on, ISel would have selected an
INSERTPSrr leaving the insertps mask in an inconsistent state:

  movss 4(%rdi), %xmm1
  insertps  $64, %xmm1, %xmm0 # xmm0 = xmm1[1],xmm0[1,2,3].

With this patch, the backend avoids folding the vector load into the operand of
the INSERTPS. The new codegen at -O0 is:

  movaps (%rdi), %xmm1
  insertps  $64, %xmm1, %xmm0 # %xmm1[1],xmm0[1,2,3].


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226277 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-16 14:55:26 +00:00
..
Analysis [PM] Port domtree to the new pass manager (at last). 2015-01-14 10:19:28 +00:00
Assembler IR: Move MDLocation into place 2015-01-14 22:27:36 +00:00
Bindings IR: Move MDLocation into place 2015-01-14 22:27:36 +00:00
Bitcode Revert r226242 - Revert Revert Don't create new comdats in CodeGen 2015-01-16 08:38:45 +00:00
BugPoint IR: Move MDLocation into place 2015-01-14 22:27:36 +00:00
CodeGen [X86][DAG] Disable target specific combine on INSERTPS dag nodes at -O0. 2015-01-16 14:55:26 +00:00
DebugInfo IR: Move MDLocation into place 2015-01-14 22:27:36 +00:00
ExecutionEngine
Feature IR: Move MDLocation into place 2015-01-14 22:27:36 +00:00
FileCheck
Instrumentation IR: Move MDLocation into place 2015-01-14 22:27:36 +00:00
Integer
JitListener IR: Move MDLocation into place 2015-01-14 22:27:36 +00:00
Linker IR: Move MDLocation into place 2015-01-14 22:27:36 +00:00
LTO
MC Revert r226242 - Revert Revert Don't create new comdats in CodeGen 2015-01-16 08:38:45 +00:00
Object Fix edge case when Start overflowed in 32 bit mode 2015-01-15 23:50:44 +00:00
Other [PM] Port TargetLibraryInfo to the new pass manager, provided by the 2015-01-15 11:39:46 +00:00
SymbolRewriter
TableGen
tools Work around to get the build bot clang-cmake-armv7-a15-full green by 2015-01-16 02:08:11 +00:00
Transforms Fix Reassociate handling of constant in presence of undef float 2015-01-16 03:00:58 +00:00
Unit
Verifier
YAMLParser
.clang-format
CMakeLists.txt
lit.cfg
lit.site.cfg.in
Makefile
Makefile.tests
TestRunner.sh