summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorAshutosh Nema <ashu1212@gmail.com>2016-04-22 08:34:05 +0000
committerAshutosh Nema <ashu1212@gmail.com>2016-04-22 08:34:05 +0000
commit468558a06135451065cd279aa4e4f7b19a190567 (patch)
treea60774a84522086caae93f1980d791ea88b44e75 /llvm
parent601970296070d04b19aae5cf665b9cde0d55ef08 (diff)
downloadbcm5719-llvm-468558a06135451065cd279aa4e4f7b19a190567.tar.gz
bcm5719-llvm-468558a06135451065cd279aa4e4f7b19a190567.zip
[X86]: Changing cost for “TRUNCATE v16i32 to v16i8” in SSE4.1 mode.
Summary: rL256194 transforms truncations between vectors of integers into PACKUS/PACKSS operations during DAG combine. This generates better code for truncate, so cost of truncate needs to be changed but looks like it got changed only in SSE2 table Whereas this change is also applicable for SSE4.1, so the cost of truncate needs to be changed for that as well. Cost of “TRUNCATE v16i32 to v16i8” & “TRUNCATE v16i16 to v16i8” should be same in SSE4.1 & SSE2 table. Removing their cost from SSE4.1, so it will fall back to SSE2. Reviewers: Simon Pilgrim llvm-svn: 267123
Diffstat (limited to 'llvm')
-rw-r--r--llvm/lib/Target/X86/X86TargetTransformInfo.cpp2
-rw-r--r--llvm/test/Analysis/CostModel/X86/sse-itoi.ll2
2 files changed, 1 insertions, 3 deletions
diff --git a/llvm/lib/Target/X86/X86TargetTransformInfo.cpp b/llvm/lib/Target/X86/X86TargetTransformInfo.cpp
index 9508539b1f5..6ffef1654ea 100644
--- a/llvm/lib/Target/X86/X86TargetTransformInfo.cpp
+++ b/llvm/lib/Target/X86/X86TargetTransformInfo.cpp
@@ -731,10 +731,8 @@ int X86TTIImpl::getCastInstrCost(unsigned Opcode, Type *Dst, Type *Src) {
{ ISD::TRUNCATE, MVT::v16i16, MVT::v16i32, 6 },
{ ISD::TRUNCATE, MVT::v8i16, MVT::v8i32, 3 },
{ ISD::TRUNCATE, MVT::v4i16, MVT::v4i32, 1 },
- { ISD::TRUNCATE, MVT::v16i8, MVT::v16i32, 30 },
{ ISD::TRUNCATE, MVT::v8i8, MVT::v8i32, 3 },
{ ISD::TRUNCATE, MVT::v4i8, MVT::v4i32, 1 },
- { ISD::TRUNCATE, MVT::v16i8, MVT::v16i16, 3 },
{ ISD::TRUNCATE, MVT::v8i8, MVT::v8i16, 1 },
{ ISD::TRUNCATE, MVT::v4i8, MVT::v4i16, 2 },
};
diff --git a/llvm/test/Analysis/CostModel/X86/sse-itoi.ll b/llvm/test/Analysis/CostModel/X86/sse-itoi.ll
index 9e7f26e54d2..13a95a81d42 100644
--- a/llvm/test/Analysis/CostModel/X86/sse-itoi.ll
+++ b/llvm/test/Analysis/CostModel/X86/sse-itoi.ll
@@ -279,7 +279,7 @@ define void @truncate_v16i32_to_v16i8(<16 x i32>* %a) {
; SSE2: cost of 7 {{.*}} trunc
;
; SSE41: truncate_v16i32_to_v16i8
-; SSE41: cost of 30 {{.*}} trunc
+; SSE41: cost of 7 {{.*}} trunc
;
%1 = load <16 x i32>, <16 x i32>* %a
%2 = trunc <16 x i32> %1 to <16 x i8>
OpenPOWER on IntegriCloud