1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 03:23:01 +02:00
llvm-mirror/lib
Andrea Di Biagio d2869df8d3 [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].

llvm-svn: 226277
2015-01-16 14:55:26 +00:00
..
Analysis [PM] Port TargetLibraryInfo to the new pass manager, provided by the 2015-01-15 11:39:46 +00:00
AsmParser AsmParser/Bitcode: Add support for MDLocation 2015-01-13 21:10:44 +00:00
Bitcode Revert r226242 - Revert Revert Don't create new comdats in CodeGen 2015-01-16 08:38:45 +00:00
CodeGen Revert r226242 - Revert Revert Don't create new comdats in CodeGen 2015-01-16 08:38:45 +00:00
DebugInfo [cleanup] Re-sort all the #include lines in LLVM using 2015-01-14 11:23:27 +00:00
ExecutionEngine Fixing pedantic build warnings. 2015-01-15 21:50:53 +00:00
IR getMangledTypeStr: clarify how it mangles types, and add tests 2015-01-14 23:05:17 +00:00
IRReader
LineEditor
Linker Use the DiagnosticHandler to print diagnostics when reading bitcode. 2015-01-10 00:07:30 +00:00
LTO Update libdeps since TLI was moved from Target to Analysis in r226078. 2015-01-15 05:21:00 +00:00
MC Replace size method call of containers to empty method where appropriate 2015-01-15 11:41:30 +00:00
Object This should fix the build bot clang-cmake-armv7-a15-full failing on 2015-01-16 00:27:31 +00:00
Option [cleanup] Re-sort all the #include lines in LLVM using 2015-01-14 11:23:27 +00:00
ProfileData Replace size method call of containers to empty method where appropriate 2015-01-15 11:41:30 +00:00
Support [cleanup] Re-sort all the #include lines in LLVM using 2015-01-14 11:23:27 +00:00
TableGen Replace size method call of containers to empty method where appropriate 2015-01-15 11:41:30 +00:00
Target [X86][DAG] Disable target specific combine on INSERTPS dag nodes at -O0. 2015-01-16 14:55:26 +00:00
Transforms Fix Reassociate handling of constant in presence of undef float 2015-01-16 03:00:58 +00:00
CMakeLists.txt
LLVMBuild.txt
Makefile