llvm-6502/test
Andrea Di Biagio 54529ed1c4 [X86] Avoid introducing extra shuffles when lowering packed vector shifts.
When lowering a vector shift node, the backend checks if the shift count is a
shuffle with a splat mask. If so, then it introduces an extra dag node to
extract the splat value from the shuffle. The splat value is then used
to generate a shift count of a target specific shift.

However, if we know that the shift count is a splat shuffle, we can use the
splat index 'I' to extract the I-th element from the first shuffle operand.
The advantage is that the splat shuffle may become dead since we no longer
use it.

Example:

;;
define <4 x i32> @example(<4 x i32> %a, <4 x i32> %b) {
  %c = shufflevector <4 x i32> %b, <4 x i32> undef, <4 x i32> zeroinitializer
  %shl = shl <4 x i32> %a, %c
  ret <4 x i32> %shl
}
;;

Before this patch, llc generated the following code (-mattr=+avx):
  vpshufd $0, %xmm1, %xmm1   # xmm1 = xmm1[0,0,0,0]
  vpxor  %xmm2, %xmm2
  vpblendw $3, %xmm1, %xmm2, %xmm1 # xmm1 = xmm1[0,1],xmm2[2,3,4,5,6,7]
  vpslld %xmm1, %xmm0, %xmm0
  retq

With this patch, the redundant splat operation is removed from the code.
  vpxor  %xmm2, %xmm2
  vpblendw $3, %xmm1, %xmm2, %xmm1 # xmm1 = xmm1[0,1],xmm2[2,3,4,5,6,7]
  vpslld %xmm1, %xmm0, %xmm0
  retq


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223461 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-05 12:13:30 +00:00
..
Analysis Revert r222039 because of bot failure. 2014-11-19 00:13:26 +00:00
Assembler Use FileCheck in a few tests. 2014-11-06 15:05:51 +00:00
Bindings [OCaml] Move Llvm.clone_module to its own Llvm_transform_utils module. 2014-12-01 19:50:39 +00:00
Bitcode Parse 'ghccc' in .ll files as the GHC convention (cc 10) 2014-12-01 21:04:44 +00:00
BugPoint
CodeGen [X86] Avoid introducing extra shuffles when lowering packed vector shifts. 2014-12-05 12:13:30 +00:00
DebugInfo Add a comment. 2014-12-05 01:02:36 +00:00
ExecutionEngine Small model and JIT generally don't go well with each other. 2014-11-25 17:14:22 +00:00
Feature Prologue support 2014-12-03 02:08:38 +00:00
FileCheck
Instrumentation [msan] allow -fsanitize-coverage=N together with -fsanitize=memory, llvm part 2014-12-03 23:28:26 +00:00
Integer
JitListener
Linker Add a few extra cases to the test. NFC. 2014-12-05 00:02:42 +00:00
LTO Add Forward Control-Flow Integrity. 2014-11-11 21:08:02 +00:00
MC Fix yet another unseen regression caused by r223113 2014-12-04 19:34:59 +00:00
Object Add missing test file 2014-12-04 09:20:13 +00:00
Other
SymbolRewriter Transform: add SymbolRewriter pass 2014-11-07 21:32:08 +00:00
TableGen
tools Re-add support to llvm-objdump for Mach-O universal files and archives with -macho 2014-12-04 23:56:27 +00:00
Transforms Add some tests for SimplifyCFG's TurnSwitchRangeIntoICmp(). NFC. 2014-12-04 22:19:28 +00:00
Unit
Verifier [Statepoints 1/4] Statepoint infrastructure for garbage collection: IR Intrinsics 2014-12-01 21:18:12 +00:00
YAMLParser
.clang-format
CMakeLists.txt Revert "Add missing test dependency and use a more canonical target name." 2014-12-04 04:33:32 +00:00
lit.cfg [OCaml] [cmake] Add CMake buildsystem for OCaml. 2014-12-01 19:50:23 +00:00
lit.site.cfg.in [OCaml] [autoconf] Migrate to ocamlfind. 2014-10-30 08:29:45 +00:00
Makefile OCAMLFLAGS can contain =, don't use = with sed 2014-11-13 09:29:30 +00:00
Makefile.tests
TestRunner.sh