Skip to content
Snippets Groups Projects
Commit f036ca46 authored by Nadav Rotem's avatar Nadav Rotem
Browse files

CostModel: add another known vector trunc optimization.

llvm-svn: 167488
parent 1e83d6f6
No related branches found
No related tags found
No related merge requests found
......@@ -17692,6 +17692,7 @@ unsigned X86VectorTargetTransformInfo::getCastInstrCost(unsigned Opcode,
{ ISD::FP_TO_SINT, MVT::v4i8, MVT::v4f32, 1 },
{ ISD::ZERO_EXTEND, MVT::v8i32, MVT::v8i1, 6 },
{ ISD::SIGN_EXTEND, MVT::v8i32, MVT::v8i1, 9 },
{ ISD::TRUNCATE, MVT::v8i32, MVT::v8i64, 3 },
};
 
if (ST.hasAVX()) {
......
......@@ -53,6 +53,9 @@ define i32 @zext_sext(<8 x i1> %in) {
;CHECK: cost of 1 {{.*}} trunc
%F = trunc <8 x i32> undef to <8 x i16>
;CHECK: cost of 3 {{.*}} trunc
%G = trunc <8 x i64> undef to <8 x i32>
ret i32 undef
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment