1; RUN: llc -O3 -march=aarch64 < %s | FileCheck %s 2 3define i16 @test_1cmp_signed_1(i16* %ptr1) { 4; CHECK-LABLE: @test_1cmp_signed_1 5; CHECK: ldrsh 6; CHECK-NEXT: cmn 7entry: 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 12if: 13 ret i16 1 14if.then: 15 ret i16 0 16} 17 18define i16 @test_1cmp_signed_2(i16* %ptr1) { 19; CHECK-LABLE: @test_1cmp_signed_2 20; CHECK: ldrsh 21; CHECK-NEXT: cmn 22entry: 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 27if: 28 ret i16 1 29if.then: 30 ret i16 0 31} 32 33define i16 @test_1cmp_unsigned_1(i16* %ptr1) { 34; CHECK-LABLE: @test_1cmp_unsigned_1 35; CHECK: ldrsh 36; CHECK-NEXT: cmn 37entry: 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 42if: 43 ret i16 1 44if.then: 45 ret i16 0 46} 47