• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: llc < %s -march=arm64 | FileCheck %s
2
3; Optimize (x > -1) to (x >= 0) etc.
4; Optimize (cmp (add / sub), 0): eliminate the subs used to update flag
5;   for comparison only
6; rdar://10233472
7
8define i32 @t1(i64 %a) nounwind ssp {
9entry:
10; CHECK-LABEL: t1:
11; CHECK-NOT: movn
12; CHECK: cmp  x0, #0
13; CHECK: cset w0, ge
14  %cmp = icmp sgt i64 %a, -1
15  %conv = zext i1 %cmp to i32
16  ret i32 %conv
17}
18