1 ; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -mcpu=corei7 -mattr=+sse2,-sse4.1 -cost-model -analyze | FileCheck %s -check-prefix=CHECK -check-prefix=SSE2
2 ; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -mcpu=core-avx2 -cost-model -analyze | FileCheck %s -check-prefix=CHECK -check-prefix=AVX2
4 define <4 x i32> @test1(<4 x i32> %a) {
5 %div = udiv <4 x i32> %a, <i32 7, i32 7, i32 7, i32 7>
8 ; CHECK: 'Cost Model Analysis' for function 'test1':
9 ; SSE2: Found an estimated cost of 15 for instruction: %div
10 ; AVX2: Found an estimated cost of 15 for instruction: %div
13 define <8 x i32> @test2(<8 x i32> %a) {
14 %div = udiv <8 x i32> %a, <i32 7, i32 7, i32 7, i32 7,i32 7, i32 7, i32 7, i32 7>
17 ; CHECK: 'Cost Model Analysis' for function 'test2':
18 ; SSE2: Found an estimated cost of 30 for instruction: %div
19 ; AVX2: Found an estimated cost of 15 for instruction: %div
22 define <8 x i16> @test3(<8 x i16> %a) {
23 %div = udiv <8 x i16> %a, <i16 7, i16 7, i16 7, i16 7, i16 7, i16 7, i16 7, i16 7>
26 ; CHECK: 'Cost Model Analysis' for function 'test3':
27 ; SSE2: Found an estimated cost of 6 for instruction: %div
28 ; AVX2: Found an estimated cost of 6 for instruction: %div
31 define <16 x i16> @test4(<16 x i16> %a) {
32 %div = udiv <16 x i16> %a, <i16 7, i16 7, i16 7, i16 7,i16 7, i16 7, i16 7, i16 7, i16 7, i16 7, i16 7, i16 7,i16 7, i16 7, i16 7, i16 7>
35 ; CHECK: 'Cost Model Analysis' for function 'test4':
36 ; SSE2: Found an estimated cost of 12 for instruction: %div
37 ; AVX2: Found an estimated cost of 6 for instruction: %div
40 define <8 x i16> @test5(<8 x i16> %a) {
41 %div = sdiv <8 x i16> %a, <i16 7, i16 7, i16 7, i16 7, i16 7, i16 7, i16 7, i16 7>
44 ; CHECK: 'Cost Model Analysis' for function 'test5':
45 ; SSE2: Found an estimated cost of 6 for instruction: %div
46 ; AVX2: Found an estimated cost of 6 for instruction: %div
49 define <16 x i16> @test6(<16 x i16> %a) {
50 %div = sdiv <16 x i16> %a, <i16 7, i16 7, i16 7, i16 7,i16 7, i16 7, i16 7, i16 7, i16 7, i16 7, i16 7, i16 7,i16 7, i16 7, i16 7, i16 7>
53 ; CHECK: 'Cost Model Analysis' for function 'test6':
54 ; SSE2: Found an estimated cost of 12 for instruction: %div
55 ; AVX2: Found an estimated cost of 6 for instruction: %div
58 define <16 x i8> @test7(<16 x i8> %a) {
59 %div = sdiv <16 x i8> %a, <i8 7, i8 7, i8 7, i8 7,i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7,i8 7, i8 7, i8 7, i8 7>
62 ; CHECK: 'Cost Model Analysis' for function 'test7':
63 ; SSE2: Found an estimated cost of 320 for instruction: %div
64 ; AVX2: Found an estimated cost of 320 for instruction: %div
67 define <4 x i32> @test8(<4 x i32> %a) {
68 %div = sdiv <4 x i32> %a, <i32 7, i32 7, i32 7, i32 7>
71 ; CHECK: 'Cost Model Analysis' for function 'test8':
72 ; SSE2: Found an estimated cost of 19 for instruction: %div
73 ; AVX2: Found an estimated cost of 15 for instruction: %div
76 define <8 x i32> @test9(<8 x i32> %a) {
77 %div = sdiv <8 x i32> %a, <i32 7, i32 7, i32 7, i32 7,i32 7, i32 7, i32 7, i32 7>
80 ; CHECK: 'Cost Model Analysis' for function 'test9':
81 ; SSE2: Found an estimated cost of 38 for instruction: %div
82 ; AVX2: Found an estimated cost of 15 for instruction: %div
85 define <8 x i32> @test10(<8 x i32> %a) {
86 %div = sdiv <8 x i32> %a, <i32 8, i32 7, i32 7, i32 7,i32 7, i32 7, i32 7, i32 7>
89 ; CHECK: 'Cost Model Analysis' for function 'test10':
90 ; SSE2: Found an estimated cost of 160 for instruction: %div
91 ; AVX2: Found an estimated cost of 160 for instruction: %div