blob: f33e24e777fe1d6f6e0a19a0939be43691e1a565 [file] [log] [blame]
Evgeny Astigeevichfd89fe02016-04-21 08:54:08 +00001; RUN: llc -mtriple=aarch64-linux-gnu -O3 -o - %s | FileCheck %s
2
3@a = external global i8, align 1
4@b = external global i8, align 1
5
6; Test that SUBS is replaced by SUB if condition flags are not used.
7define i32 @test01() nounwind {
8; CHECK: ldrb {{.*}}
9; CHECK-NEXT: ldrb {{.*}}
10; CHECK-NEXT: sub {{.*}}
11; CHECK-NEXT: cmn {{.*}}
12entry:
13 %0 = load i8, i8* @a, align 1
14 %conv = zext i8 %0 to i32
15 %1 = load i8, i8* @b, align 1
16 %conv1 = zext i8 %1 to i32
17 %s = sub nsw i32 %conv1, %conv
18 %cmp0 = icmp eq i32 %s, -1
19 %cmp1 = sext i1 %cmp0 to i8
20 store i8 %cmp1, i8* @a
21 ret i32 0
22}
23