xref: /llvm-project/llvm/test/CodeGen/AArch64/split-deadloop.mir (revision 6716d3dd77fcf9b6bb897adffb08b147f30a11c8)
1# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 3
2# RUN: llc -o - %s -run-pass=greedy | FileCheck %s
3#
4# Make sure we don't run into dead loop when split register with a hint.
5
6--- |
7  target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
8  target triple = "aarch64-none-linux-gnu"
9
10  define void @foo(ptr %0, i32 %1) gc "statepoint-example" personality ptr null {
11  bci_0:
12    unreachable
13
14  bci_19:
15    unreachable
16
17  bci_10:
18    unreachable
19  }
20
21...
22---
23name:            foo
24alignment:       4
25exposesReturnsTwice: false
26legalized:       false
27regBankSelected: false
28selected:        false
29failedISel:      false
30tracksRegLiveness: true
31hasWinCFI:       false
32callsEHReturn:   false
33callsUnwindInit: false
34hasEHCatchret:   false
35hasEHScopes:     false
36hasEHFunclets:   false
37isOutlined:      false
38debugInstrRef:   false
39failsVerification: false
40tracksDebugUserValues: false
41registers:
42  - { id: 0, class: gpr64, preferred-register: '' }
43  - { id: 1, class: gpr32, preferred-register: '' }
44  - { id: 2, class: gpr32, preferred-register: '' }
45  - { id: 3, class: gpr64all, preferred-register: '' }
46  - { id: 4, class: gpr64all, preferred-register: '' }
47  - { id: 5, class: gpr32all, preferred-register: '' }
48liveins:
49  - { reg: '$w1', virtual-reg: '%1' }
50frameInfo:
51  isFrameAddressTaken: false
52  isReturnAddressTaken: false
53  hasStackMap:     false
54  hasPatchPoint:   false
55  stackSize:       0
56  offsetAdjustment: 0
57  maxAlignment:    1
58  adjustsStack:    true
59  hasCalls:        true
60  stackProtector:  ''
61  functionContext: ''
62  maxCallFrameSize: 0
63  cvBytesOfCalleeSavedRegisters: 0
64  hasOpaqueSPAdjustment: false
65  hasVAStart:      false
66  hasMustTailInVarArgFunc: false
67  hasTailCall:     false
68  localFrameSize:  0
69  savePoint:       ''
70  restorePoint:    ''
71fixedStack:      []
72stack:           []
73entry_values:    []
74callSites:       []
75debugValueSubstitutions: []
76constants:       []
77machineFunctionInfo: {}
78body:             |
79  ; CHECK-LABEL: name: foo
80  ; CHECK: bb.0.bci_0:
81  ; CHECK-NEXT:   successors: %bb.1(0x80000000)
82  ; CHECK-NEXT:   liveins: $w1
83  ; CHECK-NEXT: {{  $}}
84  ; CHECK-NEXT:   [[COPY:%[0-9]+]]:gpr32 = COPY $w1
85  ; CHECK-NEXT: {{  $}}
86  ; CHECK-NEXT: bb.1.bci_19:
87  ; CHECK-NEXT:   ADJCALLSTACKDOWN 0, 0, implicit-def dead $sp, implicit $sp
88  ; CHECK-NEXT:   $x0 = COPY $xzr
89  ; CHECK-NEXT:   STATEPOINT 0, 0, 1, $xzr, killed $x0, 2, 0, 2, 0, 2, 33, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, [[COPY]], 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 2, 0, 2, 1, 0, 0, csr_aarch64_aapcs, implicit-def $sp, implicit-def dead $x0, implicit-def dead early-clobber $lr
90  ; CHECK-NEXT:   ADJCALLSTACKUP 0, 0, implicit-def dead $sp, implicit $sp
91  ; CHECK-NEXT:   ADJCALLSTACKDOWN 0, 0, implicit-def dead $sp, implicit $sp
92  ; CHECK-NEXT:   $w0 = COPY $wzr
93  ; CHECK-NEXT:   STATEPOINT 0, 0, 1, $xzr, killed $w0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, csr_aarch64_aapcs, implicit-def $sp, implicit-def dead early-clobber $lr
94  ; CHECK-NEXT:   ADJCALLSTACKUP 0, 0, implicit-def dead $sp, implicit $sp
95  bb.0.bci_0:
96    successors: %bb.1(0x80000000)
97    liveins: $w1
98
99    %1:gpr32 = COPY $w1
100
101  bb.1.bci_19:
102    ADJCALLSTACKDOWN 0, 0, implicit-def dead $sp, implicit $sp
103    $x0 = COPY $xzr
104    STATEPOINT 0, 0, 1, $xzr, killed $x0, 2, 0, 2, 0, 2, 33, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, %1, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 2, 0, 2, 1, 0, 0, csr_aarch64_aapcs, implicit-def $sp, implicit-def dead $x0, implicit-def dead early-clobber $lr
105    ADJCALLSTACKUP 0, 0, implicit-def dead $sp, implicit $sp
106    ADJCALLSTACKDOWN 0, 0, implicit-def dead $sp, implicit $sp
107    $w0 = COPY $wzr
108    STATEPOINT 0, 0, 1, $xzr, killed $w0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, csr_aarch64_aapcs, implicit-def $sp, implicit-def dead early-clobber $lr
109    ADJCALLSTACKUP 0, 0, implicit-def dead $sp, implicit $sp
110
111...
112