1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=thumb-eabi -mcpu=arm1156t2-s -mattr=+thumb2 %s -o - | FileCheck %s
4 ; These tests would be improved by 'movs r0, #0' being rematerialized below the
5 ; tst as 'mov.w r0, #0'.
7 define i32 @f2(i32 %a, i32 %b) {
10 ; CHECK-NEXT: movs r2, #24
11 ; CHECK-NEXT: eors r0, r1
13 ; CHECK-NEXT: moveq r2, #42
14 ; CHECK-NEXT: mov r0, r2
17 %tmp1 = icmp eq i32 %tmp, 0
18 %ret = select i1 %tmp1, i32 42, i32 24
22 define i32 @f4(i32 %a, i32 %b) {
25 ; CHECK-NEXT: movs r2, #24
26 ; CHECK-NEXT: eors r0, r1
28 ; CHECK-NEXT: moveq r2, #42
29 ; CHECK-NEXT: mov r0, r2
32 %tmp1 = icmp eq i32 0, %tmp
33 %ret = select i1 %tmp1, i32 42, i32 24
37 define i32 @f6(i32 %a, i32 %b) {
40 ; CHECK-NEXT: movs r2, #24
41 ; CHECK-NEXT: teq.w r0, r1, lsl #5
43 ; CHECK-NEXT: moveq r2, #42
44 ; CHECK-NEXT: mov r0, r2
47 %tmp1 = xor i32 %a, %tmp
48 %tmp2 = icmp eq i32 %tmp1, 0
49 %ret = select i1 %tmp2, i32 42, i32 24
53 define i32 @f7(i32 %a, i32 %b) {
56 ; CHECK-NEXT: movs r2, #24
57 ; CHECK-NEXT: teq.w r0, r1, lsr #6
59 ; CHECK-NEXT: moveq r2, #42
60 ; CHECK-NEXT: mov r0, r2
63 %tmp1 = xor i32 %a, %tmp
64 %tmp2 = icmp eq i32 %tmp1, 0
65 %ret = select i1 %tmp2, i32 42, i32 24
69 define i32 @f8(i32 %a, i32 %b) {
72 ; CHECK-NEXT: movs r2, #24
73 ; CHECK-NEXT: teq.w r0, r1, asr #7
75 ; CHECK-NEXT: moveq r2, #42
76 ; CHECK-NEXT: mov r0, r2
79 %tmp1 = xor i32 %a, %tmp
80 %tmp2 = icmp eq i32 %tmp1, 0
81 %ret = select i1 %tmp2, i32 42, i32 24
85 define i32 @f9(i32 %a, i32 %b) {
88 ; CHECK-NEXT: movs r1, #24
89 ; CHECK-NEXT: teq.w r0, r0, ror #8
91 ; CHECK-NEXT: moveq r1, #42
92 ; CHECK-NEXT: mov r0, r1
96 %tmp = or i32 %l8, %r8
97 %tmp1 = xor i32 %a, %tmp
98 %tmp2 = icmp eq i32 %tmp1, 0
99 %ret = select i1 %tmp2, i32 42, i32 24