• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: opt -cost-model -analyze -mtriple=aarch64--linux-gnu < %s | FileCheck %s
2
3; Verify the cost of integer division instructions.
4
5define i32 @sdivs1i32(i32 %a, i32 %b) {
6; CHECK-LABEL: 'Cost Model Analysis' for function 'sdivs1i32':
7; CHECK: Found an estimated cost of 1 for instruction: %c = sdiv i32 %a, %b
8  %c = sdiv i32 %a, %b
9  ret i32 %c
10}
11
12define i64 @sdivs1i64(i64 %a, i64 %b) {
13; CHECK-LABEL: 'Cost Model Analysis' for function 'sdivs1i64':
14; CHECK: Found an estimated cost of 1 for instruction: %c = sdiv i64 %a, %b
15  %c = sdiv i64 %a, %b
16  ret i64 %c
17}
18
19define <2 x i32> @sdivv2i32(<2 x i32> %a, <2 x i32> %b) {
20; CHECK-LABEL: 'Cost Model Analysis' for function 'sdivv2i32':
21; CHECK: Found an estimated cost of 24 for instruction: %c = sdiv <2 x i32> %a, %b
22  %c = sdiv <2 x i32> %a, %b
23  ret <2 x i32> %c
24}
25
26define <2 x i64> @sdivv2i64(<2 x i64> %a, <2 x i64> %b) {
27; CHECK-LABEL: 'Cost Model Analysis' for function 'sdivv2i64':
28; CHECK: Found an estimated cost of 24 for instruction: %c = sdiv <2 x i64> %a, %b
29  %c = sdiv <2 x i64> %a, %b
30  ret <2 x i64> %c
31}
32
33define <4 x i32> @sdivv4i32(<4 x i32> %a, <4 x i32> %b) {
34; CHECK-LABEL: 'Cost Model Analysis' for function 'sdivv4i32':
35; CHECK: Found an estimated cost of 52 for instruction: %c = sdiv <4 x i32> %a, %b
36  %c = sdiv <4 x i32> %a, %b
37  ret <4 x i32> %c
38}
39