llvm-6502/test
Sanjay Patel 8765e82c83 [X86, AVX] adjust tablegen patterns to generate better code for scalar insertion into zero vector (PR23073)
For code like this:

define <8 x i32> @load_v8i32() {
  ret <8 x i32> <i32 7, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
}

We produce this AVX code:

_load_v8i32:                            ## @load_v8i32
  movl	$7, %eax
  vmovd	%eax, %xmm0
  vxorps	%ymm1, %ymm1, %ymm1
  vblendps	$1, %ymm0, %ymm1, %ymm0 ## ymm0 = ymm0[0],ymm1[1,2,3,4,5,6,7]
  retq

There are at least 2 bugs in play here:

    We're generating a blend when a move scalar does the same job using 2 less instruction bytes (see FIXMEs).
    We're not matching an existing pattern that would eliminate the xor and blend entirely. The zero bytes are free with vmovd.

The 2nd fix involves an adjustment of "AddedComplexity" [1] and mostly masks the 1st problem.

[1] AddedComplexity has close to no documentation in the source. 
The best we have is this comment: "roughly corresponds to the number of nodes that are covered". 
It appears that x86 has bastardized this definition by inflating its values for some other
undocumented reason. For example, we have a pattern with "AddedComplexity = 400" (!). 

I searched my way to this page:
https://groups.google.com/forum/#!topic/llvm-dev/5UX-Og9M0xQ

Differential Revision: http://reviews.llvm.org/D8794



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233931 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-02 17:56:17 +00:00
..
Analysis [LoopAccesses] Remove unused global variables in tests 2015-04-02 04:42:51 +00:00
Assembler Verifier: Move more debug info checks away from Verify() 2015-03-31 01:28:22 +00:00
Bindings DebugInfo: Move new hierarchy into place 2015-03-03 17:24:31 +00:00
Bitcode Add testing for mismatched explicit type on a gep operator when loading from bitcode 2015-03-16 22:03:50 +00:00
BugPoint bugpoint: Verify input files 2015-03-26 05:03:10 +00:00
CodeGen [X86, AVX] adjust tablegen patterns to generate better code for scalar insertion into zero vector (PR23073) 2015-04-02 17:56:17 +00:00
DebugInfo DebugInfo: Fix testcases with invalid MDSubprogram nodes 2015-03-28 02:26:45 +00:00
ExecutionEngine [Orc] Fix local-linkage handling in the CompileOnDemand layer. 2015-04-02 05:28:10 +00:00
Feature Rewrite test/Feature/md_on_instruction.ll 2015-03-20 18:34:53 +00:00
FileCheck FileCheck: Add CHECK-SAME 2015-02-26 04:53:00 +00:00
Instrumentation DebugInfo: Fix bad debug info for compile units and types 2015-03-27 20:46:33 +00:00
Integer [opaque pointer type] Add textual IR support for explicit type parameter to gep operator 2015-03-13 18:20:45 +00:00
JitListener
Linker tools: Unify how verifyModule() is called 2015-03-31 03:07:23 +00:00
LTO libLTO, llvm-lto, gold: Introduce flag for controlling optimization level. 2015-03-19 22:01:00 +00:00
MC Revert r233595, "MC: For variable symbols, maintain MCSymbol::Section as a cache." 2015-04-02 07:02:51 +00:00
Object [opaque pointer type] Add textual IR support for explicit type parameter to gep operator 2015-03-13 18:20:45 +00:00
Other
SymbolRewriter
TableGen [AVX512] Added intrinsics for VPCMPEQB and VPCMPEQW. 2014-09-30 11:32:22 +00:00
tools Add the option -objc-meta-data to llvm-objdump used with -macho to 2015-04-01 20:57:01 +00:00
Transforms [SimplifyLibCalls] Ignore nobuiltin/unavailable fortified libcalls. 2015-04-01 00:45:09 +00:00
Unit
Verifier Verifier: Add a testcase for verifying type refs 2015-03-31 20:57:56 +00:00
YAMLParser [Support][YAML] Add support for accessing tags and tag handle substitution. 2013-10-18 22:38:04 +00:00
.clang-format Add .clang-format without column limit to subdirectory tests/. 2013-11-19 04:26:05 +00:00
CMakeLists.txt test: Fix the dependencies for the check-llvm-* targets 2015-03-25 08:07:47 +00:00
lit.cfg Tell lit.cfg about more Windows triples. 2015-03-20 22:08:40 +00:00
lit.site.cfg.in test: Make a start on a test suite for libLTO. 2015-03-19 23:55:38 +00:00
Makefile test: Make a start on a test suite for libLTO. 2015-03-19 23:55:38 +00:00
Makefile.tests Remove dead code from the makefile build system. 2013-07-25 20:25:31 +00:00
TestRunner.sh Use exec. 2010-08-29 14:49:00 +00:00