1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -debugify-and-strip-all-safe=0 -run-pass=mir-debugify -verify-machineinstrs %s -o - | FileCheck %s
4 target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
5 target triple = "aarch64-unknown-unknown"
7 define i32 @legalize_phi(i32 %argc) {
16 exposesReturnsTwice: false
18 regBankSelected: false
20 tracksRegLiveness: true
22 - { id: 0, class: _, preferred-register: '' }
23 - { id: 1, class: _, preferred-register: '' }
24 - { id: 2, class: _, preferred-register: '' }
25 - { id: 3, class: _, preferred-register: '' }
26 - { id: 4, class: _, preferred-register: '' }
27 - { id: 5, class: _, preferred-register: '' }
28 - { id: 6, class: _, preferred-register: '' }
29 - { id: 7, class: _, preferred-register: '' }
30 - { id: 8, class: _, preferred-register: '' }
31 - { id: 9, class: _, preferred-register: '' }
32 - { id: 10, class: _, preferred-register: '' }
35 ; CHECK-LABEL: name: legalize_phi
37 ; CHECK: successors: %bb.1(0x40000000), %bb.2(0x40000000)
39 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $w0, debug-location !11
40 ; CHECK: DBG_VALUE [[COPY]](s32), $noreg, !9, !DIExpression(), debug-location !11
41 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0, debug-location !DILocation(line: 2, column: 1, scope: !5)
42 ; CHECK: DBG_VALUE [[C]](s32), $noreg, !9, !DIExpression(), debug-location !DILocation(line: 2, column: 1, scope: !5)
43 ; CHECK: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 1, debug-location !DILocation(line: 3, column: 1, scope: !5)
44 ; CHECK: DBG_VALUE [[C1]](s32), $noreg, !9, !DIExpression(), debug-location !DILocation(line: 3, column: 1, scope: !5)
45 ; CHECK: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 2, debug-location !DILocation(line: 4, column: 1, scope: !5)
46 ; CHECK: DBG_VALUE [[C2]](s32), $noreg, !9, !DIExpression(), debug-location !DILocation(line: 4, column: 1, scope: !5)
47 ; CHECK: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ugt), [[COPY]](s32), [[C]], debug-location !DILocation(line: 5, column: 1, scope: !5)
48 ; CHECK: DBG_VALUE [[ICMP]](s1), $noreg, !9, !DIExpression(), debug-location !DILocation(line: 5, column: 1, scope: !5)
49 ; CHECK: G_BRCOND [[ICMP]](s1), %bb.1, debug-location !DILocation(line: 6, column: 1, scope: !5)
50 ; CHECK: G_BR %bb.2, debug-location !DILocation(line: 7, column: 1, scope: !5)
52 ; CHECK: successors: %bb.3(0x80000000)
53 ; CHECK: [[ADD:%[0-9]+]]:_(s32) = G_ADD [[COPY]], [[C1]], debug-location !DILocation(line: 8, column: 1, scope: !5)
54 ; CHECK: DBG_VALUE [[ADD]](s32), $noreg, !9, !DIExpression(), debug-location !DILocation(line: 8, column: 1, scope: !5)
55 ; CHECK: [[TRUNC:%[0-9]+]]:_(s1) = G_TRUNC [[ADD]](s32), debug-location !DILocation(line: 9, column: 1, scope: !5)
56 ; CHECK: DBG_VALUE [[TRUNC]](s1), $noreg, !9, !DIExpression(), debug-location !DILocation(line: 9, column: 1, scope: !5)
57 ; CHECK: G_BR %bb.3, debug-location !DILocation(line: 10, column: 1, scope: !5)
59 ; CHECK: successors: %bb.3(0x80000000)
60 ; CHECK: [[ADD1:%[0-9]+]]:_(s32) = G_ADD [[COPY]], [[C2]], debug-location !DILocation(line: 11, column: 1, scope: !5)
61 ; CHECK: DBG_VALUE [[ADD1]](s32), $noreg, !9, !DIExpression(), debug-location !DILocation(line: 11, column: 1, scope: !5)
62 ; CHECK: [[TRUNC1:%[0-9]+]]:_(s1) = G_TRUNC [[ADD1]](s32), debug-location !DILocation(line: 12, column: 1, scope: !5)
63 ; CHECK: DBG_VALUE [[TRUNC1]](s1), $noreg, !9, !DIExpression(), debug-location !DILocation(line: 12, column: 1, scope: !5)
65 ; CHECK: [[PHI:%[0-9]+]]:_(s1) = G_PHI [[TRUNC]](s1), %bb.1, [[TRUNC1]](s1), %bb.2, debug-location !DILocation(line: 13, column: 1, scope: !5)
66 ; CHECK: [[PHI1:%[0-9]+]]:_(s1) = G_PHI [[TRUNC]](s1), %bb.1, [[TRUNC1]](s1), %bb.2, debug-location !DILocation(line: 14, column: 1, scope: !5)
67 ; CHECK: DBG_VALUE [[PHI]](s1), $noreg, !9, !DIExpression(), debug-location !DILocation(line: 13, column: 1, scope: !5)
68 ; CHECK: DBG_VALUE [[PHI1]](s1), $noreg, !9, !DIExpression(), debug-location !DILocation(line: 14, column: 1, scope: !5)
69 ; CHECK: [[ZEXT:%[0-9]+]]:_(s32) = G_ZEXT [[PHI]](s1), debug-location !DILocation(line: 15, column: 1, scope: !5)
70 ; CHECK: DBG_VALUE [[ZEXT]](s32), $noreg, !9, !DIExpression(), debug-location !DILocation(line: 15, column: 1, scope: !5)
71 ; CHECK: $w0 = COPY [[ZEXT]](s32), debug-location !DILocation(line: 16, column: 1, scope: !5)
72 ; CHECK: DBG_VALUE $w0, $noreg, !9, !DIExpression(), debug-location !DILocation(line: 16, column: 1, scope: !5)
73 ; CHECK: RET_ReallyLR implicit $w0, debug-location !DILocation(line: 17, column: 1, scope: !5)
75 successors: %bb.1(0x40000000), %bb.2(0x40000000)
79 %1(s32) = G_CONSTANT i32 0
80 %3(s32) = G_CONSTANT i32 1
81 %6(s32) = G_CONSTANT i32 2
82 %2(s1) = G_ICMP intpred(ugt), %0(s32), %1
83 G_BRCOND %2(s1), %bb.1
87 successors: %bb.3(0x80000000)
89 %4(s32) = G_ADD %0, %3
90 %5(s1) = G_TRUNC %4(s32)
94 successors: %bb.3(0x80000000)
96 %7(s32) = G_ADD %0, %6
97 %8(s1) = G_TRUNC %7(s32)
100 %9(s1) = G_PHI %5(s1), %bb.1, %8(s1), %bb.2
101 %11:_(s1) = G_PHI %5(s1), %bb.1, %8(s1), %bb.2
102 %10(s32) = G_ZEXT %9(s1)
104 RET_ReallyLR implicit $w0