1 ; RUN: llc < %s -O3 -mtriple=aarch64-eabi | FileCheck %s 2 3 define i16 @test_1cmp_signed_1(i16* %ptr1) { 4 ; CHECK-LABEL: @test_1cmp_signed_1 5 ; CHECK: ldrsh 6 ; CHECK-NEXT: cmn 7 entry: 8 %addr = getelementptr inbounds i16, i16* %ptr1, i16 0 9 %val = load i16, i16* %addr, align 2 10 %cmp = icmp eq i16 %val, -1 11 br i1 %cmp, label %if, label %if.then 12 if: 13 ret i16 1 14 if.then: 15 ret i16 0 16 } 17 18 define i16 @test_1cmp_signed_2(i16* %ptr1) { 19 ; CHECK-LABEL: @test_1cmp_signed_2 20 ; CHECK: ldrsh 21 ; CHECK-NEXT: cmn 22 entry: 23 %addr = getelementptr inbounds i16, i16* %ptr1, i16 0 24 %val = load i16, i16* %addr, align 2 25 %cmp = icmp sge i16 %val, -1 26 br i1 %cmp, label %if, label %if.then 27 if: 28 ret i16 1 29 if.then: 30 ret i16 0 31 } 32 33 define i16 @test_1cmp_unsigned_1(i16* %ptr1) { 34 ; CHECK-LABEL: @test_1cmp_unsigned_1 35 ; CHECK: ldrsh 36 ; CHECK-NEXT: cmn 37 entry: 38 %addr = getelementptr inbounds i16, i16* %ptr1, i16 0 39 %val = load i16, i16* %addr, align 2 40 %cmp = icmp uge i16 %val, -1 41 br i1 %cmp, label %if, label %if.then 42 if: 43 ret i16 1 44 if.then: 45 ret i16 0 46 } 47