1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=msp430-- -msp430-no-legal-immediate=true < %s | FileCheck %s
4 ; Test case for the following transformation in TargetLowering::SimplifySetCC
5 ; (X & -256) == 256 -> (X >> 8) == 1
6 define i16 @testSimplifySetCC_2(i16 %x) {
7 ; CHECK-LABEL: testSimplifySetCC_2:
8 ; CHECK: ; %bb.0: ; %entry
9 ; CHECK-NEXT: and #-64, r12
10 ; CHECK-NEXT: cmp #64, r12
11 ; CHECK-NEXT: mov r2, r12
13 ; CHECK-NEXT: and #1, r12
16 %and = and i16 %x, -64
17 %cmp = icmp eq i16 %and, 64
18 %conv = zext i1 %cmp to i16
22 ; Test case for the following transformation in TargetLowering::SimplifySetCC
23 ; X > 0x0ffffffff -> (X >> 32) >= 1
24 define i16 @testSimplifySetCC_3(i16 %x) {
25 ; CHECK-LABEL: testSimplifySetCC_3:
26 ; CHECK: ; %bb.0: ; %entry
27 ; CHECK-NEXT: cmp #64, r12
28 ; CHECK-NEXT: mov r2, r12
29 ; CHECK-NEXT: and #1, r12
32 %cmp = icmp ugt i16 %x, 63
33 %conv = zext i1 %cmp to i16
37 ; Test case for the following transformation in TargetLowering::SimplifySetCC
38 ; X < 0x100000000 -> (X >> 32) < 1
39 define i16 @testSimplifySetCC_4(i16 %x) {
40 ; CHECK-LABEL: testSimplifySetCC_4:
41 ; CHECK: ; %bb.0: ; %entry
42 ; CHECK-NEXT: cmp #64, r12
43 ; CHECK-NEXT: mov #1, r12
44 ; CHECK-NEXT: bic r2, r12
47 %cmp = icmp ult i16 %x, 64
48 %conv = zext i1 %cmp to i16