File tree Expand file tree Collapse file tree 1 file changed +38
-0
lines changed
llvm/test/CodeGen/AArch64 Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Original file line number Diff line number Diff line change 1+ ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5
2+ ; RUN: llc -mtriple=aarch64-linux-gnu -O0 -fast-isel -fast-isel-abort=1 -verify-machineinstrs < %s | FileCheck %s --check-prefix=CHECK
3+
4+ ; even in -O0, cmp should be cmp
5+ define i1 @cmp(i32 %0) {
6+ ; CHECK-LABEL: cmp:
7+ ; CHECK: // %bb.0:
8+ ; CHECK-NEXT: subs w8, w0, #5
9+ ; CHECK-NEXT: cset w0, gt
10+ ; CHECK-NEXT: // kill: def $w1 killed $w0
11+ ; CHECK-NEXT: ret
12+ %2 = icmp sgt i32 %0, 5
13+ ret i1 %2
14+ }
15+
16+ define i1 @cmn(i32 %0) {
17+ ; CHECK-LABEL: cmn:
18+ ; CHECK: // %bb.0:
19+ ; CHECK-NEXT: adds w8, w0, #5
20+ ; CHECK-NEXT: cset w0, gt
21+ ; CHECK-NEXT: // kill: def $w1 killed $w0
22+ ; CHECK-NEXT: ret
23+ %2 = icmp sgt i32 %0, -5
24+ ret i1 %2
25+ }
26+
27+ ; Test that 0 is cmp
28+ define i1 @cmp0(i32 %0) {
29+ ; CHECK-LABEL: cmp0:
30+ ; CHECK: // %bb.0:
31+ ; CHECK-NEXT: subs w8, w0, #0
32+ ; CHECK-NEXT: cset w0, gt
33+ ; CHECK-NEXT: // kill: def $w1 killed $w0
34+ ; CHECK-NEXT: ret
35+ %2 = icmp sgt i32 %0, 0
36+ ret i1 %2
37+ }
38+
You can’t perform that action at this time.
0 commit comments