• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# RUN: llc -mtriple=aarch64-linux-gnu -run-pass peephole-opt -o - %s | FileCheck %s
2# CHECK: %1:gpr32common = ANDWri {{.*}}
3# CHECK-NEXT: $wzr = SUBSWri {{.*}}
4--- |
5  define i32 @test01() nounwind {
6  entry:
7    %0 = select i1 true, i32 1, i32 0
8    %1 = and i32 %0, 65535
9    %2 = icmp ugt i32 %1, 0
10    br i1 %2, label %if.then, label %if.end
11
12  if.then:                                      ; preds = %entry
13    ret i32 1
14
15  if.end:                                       ; preds = %entry
16    ret i32 0
17  }
18...
19---
20name:            test01
21registers:
22  - { id: 0, class: gpr32 }
23  - { id: 1, class: gpr32common }
24body:             |
25  bb.0.entry:
26    successors: %bb.2.if.end, %bb.1.if.then
27
28    %0 = MOVi32imm 1
29    %1 = ANDWri killed %1, 15
30    $wzr = SUBSWri killed %1, 0, 0, implicit-def $nzcv
31    Bcc 9, %bb.2.if.end, implicit $nzcv
32
33  bb.1.if.then:
34    $w0 = MOVi32imm 1
35    RET_ReallyLR implicit $w0
36
37  bb.2.if.end:
38    $w0 = MOVi32imm 0
39    RET_ReallyLR implicit $w0
40
41...
42