Clang] Fix expansion of response files in -Wp after integrated-cc1 change
[llvm-project.git] / llvm / test / Analysis / CostModel / ARM / freeshift.ll
blob464b552258205cdd6c368ededdee7f5fb23ae723
1 ; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py
2 ; RUN: opt -cost-model -analyze -mtriple=thumbv8.1m.main-none-eabi < %s | FileCheck %s
4 define void @shl(i32 %a, i32 %b) {
5 ; CHECK-LABEL: 'shl'
6 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %as = shl i32 %a, 3
7 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %ac = add i32 %b, %as
8 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %ss = shl i32 %a, 3
9 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %sc = sub i32 %b, %ss
10 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %xs = shl i32 %a, 3
11 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %xc = xor i32 %b, %xs
12 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %ns = shl i32 %a, 3
13 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %nc = and i32 %b, %ns
14 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %os = shl i32 %a, 3
15 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %oc = or i32 %b, %os
16 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %is = shl i32 %a, 3
17 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %ic = icmp eq i32 %b, %is
18 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
20   %as = shl i32 %a, 3
21   %ac = add i32 %b, %as
22   %ss = shl i32 %a, 3
23   %sc = sub i32 %b, %ss
24   %xs = shl i32 %a, 3
25   %xc = xor i32 %b, %xs
26   %ns = shl i32 %a, 3
27   %nc = and i32 %b, %ns
28   %os = shl i32 %a, 3
29   %oc = or i32 %b, %os
30   %is = shl i32 %a, 3
31   %ic = icmp eq i32 %b, %is
32   ret void
35 define void @ashr(i32 %a, i32 %b) {
36 ; CHECK-LABEL: 'ashr'
37 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %as = ashr i32 %a, 3
38 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %ac = add i32 %b, %as
39 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %ss = ashr i32 %a, 3
40 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %sc = sub i32 %b, %ss
41 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %xs = ashr i32 %a, 3
42 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %xc = xor i32 %b, %xs
43 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %ns = ashr i32 %a, 3
44 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %nc = and i32 %b, %ns
45 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %os = ashr i32 %a, 3
46 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %oc = or i32 %b, %os
47 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %is = ashr i32 %a, 3
48 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %ic = icmp eq i32 %b, %is
49 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
51   %as = ashr i32 %a, 3
52   %ac = add i32 %b, %as
53   %ss = ashr i32 %a, 3
54   %sc = sub i32 %b, %ss
55   %xs = ashr i32 %a, 3
56   %xc = xor i32 %b, %xs
57   %ns = ashr i32 %a, 3
58   %nc = and i32 %b, %ns
59   %os = ashr i32 %a, 3
60   %oc = or i32 %b, %os
61   %is = ashr i32 %a, 3
62   %ic = icmp eq i32 %b, %is
63   ret void
66 define void @lshr(i32 %a, i32 %b) {
67 ; CHECK-LABEL: 'lshr'
68 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %as = lshr i32 %a, 3
69 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %ac = add i32 %b, %as
70 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %ss = lshr i32 %a, 3
71 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %sc = sub i32 %b, %ss
72 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %xs = lshr i32 %a, 3
73 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %xc = xor i32 %b, %xs
74 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %ns = lshr i32 %a, 3
75 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %nc = and i32 %b, %ns
76 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %os = lshr i32 %a, 3
77 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %oc = or i32 %b, %os
78 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %is = lshr i32 %a, 3
79 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %ic = icmp eq i32 %b, %is
80 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
82   %as = lshr i32 %a, 3
83   %ac = add i32 %b, %as
84   %ss = lshr i32 %a, 3
85   %sc = sub i32 %b, %ss
86   %xs = lshr i32 %a, 3
87   %xc = xor i32 %b, %xs
88   %ns = lshr i32 %a, 3
89   %nc = and i32 %b, %ns
90   %os = lshr i32 %a, 3
91   %oc = or i32 %b, %os
92   %is = lshr i32 %a, 3
93   %ic = icmp eq i32 %b, %is
94   ret void