[X86] Add target specific combine rules to fold SSE2/AVX2 packed arithmetic shift...
authorAndrea Di Biagio <Andrea_DiBiagio@sn.scee.net>
Thu, 8 May 2014 17:44:04 +0000 (17:44 +0000)
committerAndrea Di Biagio <Andrea_DiBiagio@sn.scee.net>
Thu, 8 May 2014 17:44:04 +0000 (17:44 +0000)
commit2360e51fd085fdf34d720abf8cf2009bc9f35242
treeb87ac8c86e2f106a5851f299befb824ab7f4d8c0
parentf37151a2fde32fe05eaeb9e88d8738e61a0e2eb8
[X86] Add target specific combine rules to fold SSE2/AVX2 packed arithmetic shift intrinsics.

This patch teaches the backend how to combine packed SSE2/AVX2 arithmetic shift
intrinsics.

The rules are:
 - Always fold a packed arithmetic shift by zero to its first operand;
 - Convert a packed arithmetic shift intrinsic dag node into a ISD::SRA only if
   the shift count is known to be smaller than the vector element size.

This patch also teaches to function 'getTargetVShiftByConstNode' how fold
target specific vector shifts by zero.

Added two new tests to verify that the DAGCombiner is able to fold
sequences of SSE2/AVX2 packed arithmetic shift calls.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@208342 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86ISelLowering.cpp
test/CodeGen/X86/combine-avx2-intrinsics.ll [new file with mode: 0644]
test/CodeGen/X86/combine-sse2-intrinsics.ll [new file with mode: 0644]