1 ; RUN: opt -cost-model -analyze -mtriple=aarch64-linux-gnu -mattr=+neon < %s | FileCheck %s
3 ; Verify the cost of integer division by constant.
5 define <16 x i8> @sdiv8xi16(<16 x i8> %x) {
6 ; CHECK-LABEL: 'Cost Model Analysis' for function 'sdiv8xi16':
7 ; CHECK: Found an estimated cost of 9 for instruction: %div = sdiv <16 x i8> %x, <i8 9, i8 9, i8 9, i8 9, i8 9, i8 9, i8 9, i8 9, i8 9, i8 9, i8 9, i8 9, i8 9, i8 9, i8 9, i8 9>
8 %div = sdiv <16 x i8> %x, <i8 9, i8 9, i8 9, i8 9, i8 9, i8 9, i8 9, i8 9, i8 9, i8 9, i8 9, i8 9, i8 9, i8 9, i8 9, i8 9>
12 define <8 x i16> @sdiv16xi8(<8 x i16> %x) {
13 ; CHECK-LABEL: 'Cost Model Analysis' for function 'sdiv16xi8':
14 ; CHECK: Found an estimated cost of 9 for instruction: %div = sdiv <8 x i16> %x, <i16 9, i16 9, i16 9, i16 9, i16 9, i16 9, i16 9, i16 9>
15 %div = sdiv <8 x i16> %x, <i16 9, i16 9, i16 9, i16 9, i16 9, i16 9, i16 9, i16 9>
19 define <4 x i32> @sdiv32xi4(<4 x i32> %x) {
20 ; CHECK-LABEL: 'Cost Model Analysis' for function 'sdiv32xi4':
21 ; CHECK: Found an estimated cost of 9 for instruction: %div = sdiv <4 x i32> %x, <i32 9, i32 9, i32 9, i32 9>
22 %div = sdiv <4 x i32> %x, <i32 9, i32 9, i32 9, i32 9>
26 define <16 x i8> @udiv8xi16(<16 x i8> %x) {
27 ; CHECK-LABEL: 'Cost Model Analysis' for function 'udiv8xi16':
28 ; CHECK: Found an estimated cost of 9 for instruction: %div = udiv <16 x i8> %x, <i8 9, i8 9, i8 9, i8 9, i8 9, i8 9, i8 9, i8 9, i8 9, i8 9, i8 9, i8 9, i8 9, i8 9, i8 9, i8 9>
29 %div = udiv <16 x i8> %x, <i8 9, i8 9, i8 9, i8 9, i8 9, i8 9, i8 9, i8 9, i8 9, i8 9, i8 9, i8 9, i8 9, i8 9, i8 9, i8 9>
33 define <8 x i16> @udiv16xi8(<8 x i16> %x) {
34 ; CHECK-LABEL: 'Cost Model Analysis' for function 'udiv16xi8':
35 ; CHECK: Found an estimated cost of 9 for instruction: %div = udiv <8 x i16> %x, <i16 9, i16 9, i16 9, i16 9, i16 9, i16 9, i16 9, i16 9>
36 %div = udiv <8 x i16> %x, <i16 9, i16 9, i16 9, i16 9, i16 9, i16 9, i16 9, i16 9>
40 define <4 x i32> @udiv32xi4(<4 x i32> %x) {
41 ; CHECK-LABEL: Printing analysis 'Cost Model Analysis' for function 'udiv32xi4':
42 ; CHECK: Found an estimated cost of 9 for instruction: %div = udiv <4 x i32> %x, <i32 9, i32 9, i32 9, i32 9>
43 %div = udiv <4 x i32> %x, <i32 9, i32 9, i32 9, i32 9>