1 # RUN: llc -mtriple aarch64 -run-pass=early-tailduplication -verify-machineinstrs %s -o - 2>&1 | FileCheck %s
4 tracksRegLiveness: true
6 ; This test checks that the COPY3 and COPY4 copies are correctly placed in the bb.5 block,
9 ; CHECK-LABEL: name: pluto
11 ; CHECK: successors: %bb.1(0x40000000), %bb.2(0x40000000)
13 ; CHECK: [[DEF:%[0-9]+]]:gpr32 = IMPLICIT_DEF
14 ; CHECK: [[DEF1:%[0-9]+]]:gpr32common = IMPLICIT_DEF
15 ; CHECK: [[DEF2:%[0-9]+]]:gpr64 = IMPLICIT_DEF
16 ; CHECK: [[DEF3:%[0-9]+]]:gpr64common = IMPLICIT_DEF
17 ; CHECK: [[MOVi32imm:%[0-9]+]]:gpr32 = MOVi32imm 1
18 ; CHECK: [[FMOVD0_:%[0-9]+]]:fpr64 = FMOVD0
19 ; CHECK: TBNZW [[DEF]], 0, %bb.1
22 ; CHECK: successors: %bb.9(0x80000000)
23 ; CHECK: [[LDRXui:%[0-9]+]]:gpr64 = LDRXui [[DEF3]], 0 :: (load (s64) from `ptr undef`)
26 ; CHECK: successors: %bb.3(0x40000000), %bb.4(0x40000000)
27 ; CHECK: $wzr = SUBSWri [[DEF1]], 19, 0, implicit-def $nzcv
28 ; CHECK: [[CSINCWr:%[0-9]+]]:gpr32 = CSINCWr $wzr, $wzr, 1, implicit $nzcv
29 ; CHECK: TBNZW [[CSINCWr]], 0, %bb.3
32 ; CHECK: successors: %bb.9(0x80000000)
33 ; CHECK: [[SCVTFUXDri:%[0-9]+]]:fpr64 = SCVTFUXDri [[DEF2]], implicit $fpcr
34 ; CHECK: [[COPY:%[0-9]+]]:gpr64 = COPY [[SCVTFUXDri]]
35 ; CHECK: [[COPY1:%[0-9]+]]:fpr64 = COPY [[SCVTFUXDri]]
38 ; CHECK: successors: %bb.5(0x40000000), %bb.8(0x40000000)
39 ; CHECK: TBNZW [[DEF]], 0, %bb.5
42 ; CHECK: successors: %bb.9(0x80000000)
43 ; CHECK: [[COPY2:%[0-9]+]]:fpr64 = COPY [[DEF2]]
44 ; CHECK: [[COPY3:%[0-9]+]]:gpr64 = COPY [[COPY2]]
45 ; CHECK: [[COPY4:%[0-9]+]]:fpr64 = COPY [[DEF2]]
48 ; CHECK: successors: %bb.9(0x80000000)
50 ; CHECK: [[PHI:%[0-9]+]]:gpr64 = PHI [[LDRXui]], %bb.1, [[FMOVD0_]], %bb.8, [[COPY]], %bb.3, [[COPY3]], %bb.5
51 ; CHECK: ADJCALLSTACKDOWN 0, 0, implicit-def $sp, implicit $sp
52 ; CHECK: $d0 = COPY [[PHI]]
53 ; CHECK: BL @pluto, csr_aarch64_aapcs, implicit-def $lr, implicit $sp, implicit $d0, implicit-def $d0
54 ; CHECK: ADJCALLSTACKUP 0, 0, implicit-def $sp, implicit $sp
55 ; CHECK: $w0 = COPY [[MOVi32imm]]
56 ; CHECK: RET_ReallyLR implicit $w0
59 successors: %bb.2(0x40000000), %bb.3(0x40000000)
62 %1:gpr32 = IMPLICIT_DEF
63 %2:gpr32common = IMPLICIT_DEF
64 %5:gpr64 = IMPLICIT_DEF
65 %9:gpr64common = IMPLICIT_DEF
66 %13:gpr32 = MOVi32imm 1
72 successors: %bb.8(0x80000000)
74 %8:gpr64 = LDRXui %9, 0 :: (load (s64) from `ptr undef`)
78 successors: %bb.4(0x40000000), %bb.5(0x40000000)
80 $wzr = SUBSWri %2, 19, 0, implicit-def $nzcv
81 %15:gpr32 = CSINCWr $wzr, $wzr, 1, implicit $nzcv
86 successors: %bb.7(0x80000000)
88 %6:fpr64 = SCVTFUXDri %5, implicit $fpcr
92 successors: %bb.6(0x40000000), %bb.9(0x40000000)
98 successors: %bb.7(0x80000000)
102 successors: %bb.8(0x80000000)
104 %7:fpr64 = PHI %6, %bb.4, %5, %bb.6
107 successors: %bb.10(0x80000000)
109 %10:gpr64 = PHI %8, %bb.2, %7, %bb.7
113 successors: %bb.10(0x80000000)
117 %11:gpr64 = PHI %10, %bb.8, %14, %bb.9
118 ADJCALLSTACKDOWN 0, 0, implicit-def $sp, implicit $sp
120 BL @pluto, csr_aarch64_aapcs, implicit-def $lr, implicit $sp, implicit $d0, implicit-def $d0
121 ADJCALLSTACKUP 0, 0, implicit-def $sp, implicit $sp
123 RET_ReallyLR implicit $w0