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 3--- | 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 0 10 } 11 12... 13--- 14name: legalize_phi 15alignment: 4 16exposesReturnsTwice: false 17legalized: false 18regBankSelected: false 19selected: false 20tracksRegLiveness: true 21registers: 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_phi 36 ; CHECK: bb.0: 37 ; CHECK: successors: %bb.1(0x40000000), %bb.2(0x40000000) 38 ; CHECK: liveins: $w0 39 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $w0, debug-location !10 40 ; CHECK: DBG_VALUE [[COPY]](s32), $noreg, !8, !DIExpression(), debug-location !10 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, !8, !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, !8, !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, !8, !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, !8, !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) 51 ; CHECK: bb.1: 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, !8, !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, !8, !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) 58 ; CHECK: bb.2: 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, !8, !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, !8, !DIExpression(), debug-location !DILocation(line: 12, column: 1, scope: !5) 64 ; CHECK: bb.3: 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, !8, !DIExpression(), debug-location !DILocation(line: 13, column: 1, scope: !5) 68 ; CHECK: DBG_VALUE [[PHI1]](s1), $noreg, !8, !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, !8, !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, !8, !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) 74 bb.0: 75 successors: %bb.1(0x40000000), %bb.2(0x40000000) 76 liveins: $w0 77 78 %0(s32) = COPY $w0 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 84 G_BR %bb.2 85 86 bb.1: 87 successors: %bb.3(0x80000000) 88 89 %4(s32) = G_ADD %0, %3 90 %5(s1) = G_TRUNC %4(s32) 91 G_BR %bb.3 92 93 bb.2: 94 successors: %bb.3(0x80000000) 95 96 %7(s32) = G_ADD %0, %6 97 %8(s1) = G_TRUNC %7(s32) 98 99 bb.3: 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) 103 $w0 = COPY %10(s32) 104 RET_ReallyLR implicit $w0 105 106... 107