113 lines · plain
1# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py2# RUN: llc -debugify-and-strip-all-safe=0 -run-pass=mir-debugify -verify-machineinstrs %s -o - | FileCheck %s3--- |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"6 7 define i32 @legalize_phi(i32 %argc) {8 entry:9 ret i32 010 }11 12...13---14name: legalize_phi15alignment: 416exposesReturnsTwice: false17legalized: false18regBankSelected: false19selected: false20tracksRegLiveness: true21registers: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: '' }33liveins:34body: |35 ; CHECK-LABEL: name: legalize_phi36 ; CHECK: bb.0:37 ; CHECK-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)38 ; CHECK-NEXT: liveins: $w039 ; CHECK-NEXT: {{ $}}40 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $w0, debug-location !1141 ; CHECK-NEXT: DBG_VALUE [[COPY]](s32), $noreg, !9, !DIExpression(), debug-location !1142 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0, debug-location !DILocation(line: 2, column: 1, scope: !5)43 ; CHECK-NEXT: DBG_VALUE [[C]](s32), $noreg, !9, !DIExpression(), debug-location !DILocation(line: 2, column: 1, scope: !5)44 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 1, debug-location !DILocation(line: 3, column: 1, scope: !5)45 ; CHECK-NEXT: DBG_VALUE [[C1]](s32), $noreg, !9, !DIExpression(), debug-location !DILocation(line: 3, column: 1, scope: !5)46 ; CHECK-NEXT: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 2, debug-location !DILocation(line: 4, column: 1, scope: !5)47 ; CHECK-NEXT: DBG_VALUE [[C2]](s32), $noreg, !9, !DIExpression(), debug-location !DILocation(line: 4, column: 1, scope: !5)48 ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ugt), [[COPY]](s32), [[C]], debug-location !DILocation(line: 5, column: 1, scope: !5)49 ; CHECK-NEXT: DBG_VALUE [[ICMP]](s1), $noreg, !9, !DIExpression(), debug-location !DILocation(line: 5, column: 1, scope: !5)50 ; CHECK-NEXT: G_BRCOND [[ICMP]](s1), %bb.1, debug-location !DILocation(line: 6, column: 1, scope: !5)51 ; CHECK-NEXT: G_BR %bb.2, debug-location !DILocation(line: 7, column: 1, scope: !5)52 ; CHECK-NEXT: {{ $}}53 ; CHECK-NEXT: bb.1:54 ; CHECK-NEXT: successors: %bb.3(0x80000000)55 ; CHECK-NEXT: {{ $}}56 ; CHECK-NEXT: [[ADD:%[0-9]+]]:_(s32) = G_ADD [[COPY]], [[C1]], debug-location !DILocation(line: 8, column: 1, scope: !5)57 ; CHECK-NEXT: DBG_VALUE [[ADD]](s32), $noreg, !9, !DIExpression(), debug-location !DILocation(line: 8, column: 1, scope: !5)58 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:_(s1) = G_TRUNC [[ADD]](s32), debug-location !DILocation(line: 9, column: 1, scope: !5)59 ; CHECK-NEXT: DBG_VALUE [[TRUNC]](s1), $noreg, !9, !DIExpression(), debug-location !DILocation(line: 9, column: 1, scope: !5)60 ; CHECK-NEXT: G_BR %bb.3, debug-location !DILocation(line: 10, column: 1, scope: !5)61 ; CHECK-NEXT: {{ $}}62 ; CHECK-NEXT: bb.2:63 ; CHECK-NEXT: successors: %bb.3(0x80000000)64 ; CHECK-NEXT: {{ $}}65 ; CHECK-NEXT: [[ADD1:%[0-9]+]]:_(s32) = G_ADD [[COPY]], [[C2]], debug-location !DILocation(line: 11, column: 1, scope: !5)66 ; CHECK-NEXT: DBG_VALUE [[ADD1]](s32), $noreg, !9, !DIExpression(), debug-location !DILocation(line: 11, column: 1, scope: !5)67 ; CHECK-NEXT: [[TRUNC1:%[0-9]+]]:_(s1) = G_TRUNC [[ADD1]](s32), debug-location !DILocation(line: 12, column: 1, scope: !5)68 ; CHECK-NEXT: DBG_VALUE [[TRUNC1]](s1), $noreg, !9, !DIExpression(), debug-location !DILocation(line: 12, column: 1, scope: !5)69 ; CHECK-NEXT: {{ $}}70 ; CHECK-NEXT: bb.3:71 ; CHECK-NEXT: [[PHI:%[0-9]+]]:_(s1) = G_PHI [[TRUNC]](s1), %bb.1, [[TRUNC1]](s1), %bb.2, debug-location !DILocation(line: 13, column: 1, scope: !5)72 ; CHECK-NEXT: [[PHI1:%[0-9]+]]:_(s1) = G_PHI [[TRUNC]](s1), %bb.1, [[TRUNC1]](s1), %bb.2, debug-location !DILocation(line: 14, column: 1, scope: !5)73 ; CHECK-NEXT: DBG_VALUE [[PHI]](s1), $noreg, !9, !DIExpression(), debug-location !DILocation(line: 13, column: 1, scope: !5)74 ; CHECK-NEXT: DBG_VALUE [[PHI1]](s1), $noreg, !9, !DIExpression(), debug-location !DILocation(line: 14, column: 1, scope: !5)75 ; CHECK-NEXT: [[ZEXT:%[0-9]+]]:_(s32) = G_ZEXT [[PHI]](s1), debug-location !DILocation(line: 15, column: 1, scope: !5)76 ; CHECK-NEXT: DBG_VALUE [[ZEXT]](s32), $noreg, !9, !DIExpression(), debug-location !DILocation(line: 15, column: 1, scope: !5)77 ; CHECK-NEXT: $w0 = COPY [[ZEXT]](s32), debug-location !DILocation(line: 16, column: 1, scope: !5)78 ; CHECK-NEXT: DBG_VALUE $w0, $noreg, !9, !DIExpression(), debug-location !DILocation(line: 16, column: 1, scope: !5)79 ; CHECK-NEXT: RET_ReallyLR implicit $w0, debug-location !DILocation(line: 17, column: 1, scope: !5)80 bb.0:81 successors: %bb.1(0x40000000), %bb.2(0x40000000)82 liveins: $w083 84 %0(s32) = COPY $w085 %1(s32) = G_CONSTANT i32 086 %3(s32) = G_CONSTANT i32 187 %6(s32) = G_CONSTANT i32 288 %2(s1) = G_ICMP intpred(ugt), %0(s32), %189 G_BRCOND %2(s1), %bb.190 G_BR %bb.291 92 bb.1:93 successors: %bb.3(0x80000000)94 95 %4(s32) = G_ADD %0, %396 %5(s1) = G_TRUNC %4(s32)97 G_BR %bb.398 99 bb.2:100 successors: %bb.3(0x80000000)101 102 %7(s32) = G_ADD %0, %6103 %8(s1) = G_TRUNC %7(s32)104 105 bb.3:106 %9(s1) = G_PHI %5(s1), %bb.1, %8(s1), %bb.2107 %11:_(s1) = G_PHI %5(s1), %bb.1, %8(s1), %bb.2108 %10(s32) = G_ZEXT %9(s1)109 $w0 = COPY %10(s32)110 RET_ReallyLR implicit $w0111 112...113