[X86][SSE] Transform truncations between vectors of integers into X86ISD::PACKUS...
authorCong Hou <congh@google.com>
Mon, 21 Dec 2015 20:42:43 +0000 (20:42 +0000)
committerCong Hou <congh@google.com>
Mon, 21 Dec 2015 20:42:43 +0000 (20:42 +0000)
commit0d04e8753577b86691192ade4fb0e0bd314e70c5
treebe6a606a2fdf84a1f2a05de03749a5ac0593eca6
parente3e5614a18e04de516370be7ae55724d8592571b
[X86][SSE] Transform truncations between vectors of integers into X86ISD::PACKUS/PACKSS operations during DAG combine.

This patch transforms truncation between vectors of integers into
X86ISD::PACKUS/PACKSS operations during DAG combine. We don't do it in
lowering phase because after type legalization, the original truncation
will be turned into a BUILD_VECTOR with each element that is extracted
from a vector and then truncated, and from them it is difficult to do
this optimization. This greatly improves the performance of truncations
on some specific types.

Cost table is updated accordingly.

Differential revision: http://reviews.llvm.org/D14588

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256194 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86ISelLowering.cpp
lib/Target/X86/X86TargetTransformInfo.cpp
test/Analysis/CostModel/X86/sse-itoi.ll
test/CodeGen/X86/vector-trunc.ll