%F = sext <32 x i8> undef to <32 x i16>
ret void
}
+
+define void @trunc256() "min-legal-vector-width"="256" {
+; VEC256-LABEL: 'trunc256'
+; VEC256-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %A = trunc <8 x i64> undef to <8 x i32>
+; VEC256-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %B = trunc <8 x i64> undef to <8 x i16>
+; VEC256-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %C = trunc <8 x i64> undef to <8 x i8>
+; VEC256-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %D = trunc <16 x i32> undef to <16 x i16>
+; VEC256-NEXT: Cost Model: Found an estimated cost of 7 for instruction: %E = trunc <16 x i32> undef to <16 x i8>
+; VEC256-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %F = trunc <32 x i16> undef to <32 x i8>
+; VEC256-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
+;
+; VEC512-LABEL: 'trunc256'
+; VEC512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %A = trunc <8 x i64> undef to <8 x i32>
+; VEC512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %B = trunc <8 x i64> undef to <8 x i16>
+; VEC512-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %C = trunc <8 x i64> undef to <8 x i8>
+; VEC512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %D = trunc <16 x i32> undef to <16 x i16>
+; VEC512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %E = trunc <16 x i32> undef to <16 x i8>
+; VEC512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %F = trunc <32 x i16> undef to <32 x i8>
+; VEC512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
+;
+ %A = trunc <8 x i64> undef to <8 x i32>
+ %B = trunc <8 x i64> undef to <8 x i16>
+ %C = trunc <8 x i64> undef to <8 x i8>
+ %D = trunc <16 x i32> undef to <16 x i16>
+ %E = trunc <16 x i32> undef to <16 x i8>
+ %F = trunc <32 x i16> undef to <32 x i8>
+ ret void
+}