1 # RUN: llc -mtriple=aarch64-apple-ios -run-pass=early-tailduplication %s -o - | FileCheck %s
4 ; ModuleID = 'taildup.ll'
5 source_filename = "taildup.ll"
6 target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128"
7 target triple = "aarch64-apple-ios"
9 @bb1 = global ptr blockaddress(@foo, %final)
10 @bb2 = global ptr inttoptr (i32 1 to ptr)
12 define void @foo(i1 %tst, ptr %ptr) {
13 br i1 %tst, label %left, label %right
16 %val.left = call i32 @bar()
20 %val.right = call i32 @baz()
23 next: ; preds = %right, %left
24 %val = phi i32 [ %val.left, %left ], [ %val.right, %right ]
25 store i32 %val, ptr %ptr, align 4
28 final: ; preds = %next
41 exposesReturnsTwice: false
43 regBankSelected: false
46 tracksRegLiveness: true
49 - { id: 0, class: gpr32all, preferred-register: '' }
50 - { id: 1, class: gpr32all, preferred-register: '' }
51 - { id: 2, class: gpr32, preferred-register: '' }
52 - { id: 3, class: gpr32, preferred-register: '' }
53 - { id: 4, class: gpr64common, preferred-register: '' }
54 - { id: 5, class: gpr32all, preferred-register: '' }
55 - { id: 6, class: gpr32all, preferred-register: '' }
56 - { id: 7, class: gpr32all, preferred-register: '' }
58 - { reg: '$w0', virtual-reg: '%3' }
59 - { reg: '$x1', virtual-reg: '%4' }
61 isFrameAddressTaken: false
62 isReturnAddressTaken: false
72 cvBytesOfCalleeSavedRegisters: 0
73 hasOpaqueSPAdjustment: false
75 hasMustTailInVarArgFunc: false
83 debugValueSubstitutions: []
85 machineFunctionInfo: {}
88 successors: %bb.1(0x40000000), %bb.2(0x40000000)
91 %4:gpr64common = COPY $x1
97 successors: %bb.3(0x80000000)
99 ADJCALLSTACKDOWN 0, 0, implicit-def dead $sp, implicit $sp
100 BL @bar, csr_darwin_aarch64_aapcs, implicit-def dead $lr, implicit $sp, implicit-def $sp, implicit-def $w0
101 ADJCALLSTACKUP 0, 0, implicit-def dead $sp, implicit $sp
102 %6:gpr32all = COPY $w0
103 %0:gpr32all = COPY %6
107 successors: %bb.3(0x80000000)
109 ADJCALLSTACKDOWN 0, 0, implicit-def dead $sp, implicit $sp
110 BL @baz, csr_darwin_aarch64_aapcs, implicit-def dead $lr, implicit $sp, implicit-def $sp, implicit-def $w0
111 ADJCALLSTACKUP 0, 0, implicit-def dead $sp, implicit $sp
112 %5:gpr32all = COPY $w0
113 %1:gpr32all = COPY %5
116 successors: %bb.4(0x80000000)
118 ; CHECK: %2:gpr32 = PHI
119 %2:gpr32 = PHI %1, %bb.2, %0, %bb.1
120 STRWui %2, %4, 0 :: (store (s32) into %ir.ptr)
122 bb.4.final (ir-block-address-taken %ir-block.final):
123 ADJCALLSTACKDOWN 0, 0, implicit-def dead $sp, implicit $sp
124 BL @bar, csr_darwin_aarch64_aapcs, implicit-def dead $lr, implicit $sp, implicit-def $sp, implicit-def $w0
125 ADJCALLSTACKUP 0, 0, implicit-def dead $sp, implicit $sp
126 %7:gpr32all = COPY $w0