From: Nadav Rotem Date: Tue, 6 Nov 2012 21:17:17 +0000 (+0000) Subject: CostModel: add another known vector trunc optimization. X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f036ca466e72be59530679068ac8f817c3b1dbe5;p=platform%2Fupstream%2Fllvm.git CostModel: add another known vector trunc optimization. llvm-svn: 167488 --- diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp index 5853b51..bdbc9bb 100644 --- a/llvm/lib/Target/X86/X86ISelLowering.cpp +++ b/llvm/lib/Target/X86/X86ISelLowering.cpp @@ -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()) { diff --git a/llvm/test/Analysis/CostModel/X86/cast.ll b/llvm/test/Analysis/CostModel/X86/cast.ll index 298d5c6..75c97a7 100644 --- a/llvm/test/Analysis/CostModel/X86/cast.ll +++ b/llvm/test/Analysis/CostModel/X86/cast.ll @@ -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 }