1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 4
2 # RUN: llc --verify-machineinstrs -mtriple=aarch64 -o - %s -run-pass pipeliner -aarch64-enable-pipeliner -pipeliner-mve-cg -pipeliner-force-ii=3 -mcpu=neoverse-n1 2>&1 | FileCheck %s
4 # test pipeliner code genearation by MVE algorithm
5 # COPY instructions exist
10 tracksRegLiveness: true
12 ; CHECK-LABEL: name: func
14 ; CHECK-NEXT: successors: %bb.3(0x80000000)
15 ; CHECK-NEXT: liveins: $x0, $x1
17 ; CHECK-NEXT: dead [[COPY:%[0-9]+]]:gpr64 = COPY $x0
18 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:gpr64common = COPY $x1
19 ; CHECK-NEXT: [[FMOVDi:%[0-9]+]]:fpr64 = FMOVDi 1
23 ; CHECK-NEXT: successors: %bb.4(0x40000000), %bb.7(0x40000000)
25 ; CHECK-NEXT: dead $xzr = SUBSXrr [[COPY1]], [[COPY1]], implicit-def $nzcv
26 ; CHECK-NEXT: [[CSINCXr:%[0-9]+]]:gpr64common = CSINCXr $xzr, $xzr, 1, implicit $nzcv
27 ; CHECK-NEXT: [[ADDXrr:%[0-9]+]]:gpr64 = ADDXrr [[COPY1]], [[COPY1]]
28 ; CHECK-NEXT: dead $xzr = SUBSXrr [[ADDXrr]], [[COPY1]], implicit-def $nzcv
29 ; CHECK-NEXT: [[CSINCXr1:%[0-9]+]]:gpr64common = CSINCXr [[CSINCXr]], [[CSINCXr]], 1, implicit $nzcv
30 ; CHECK-NEXT: [[ADDXrr1:%[0-9]+]]:gpr64 = ADDXrr [[ADDXrr]], [[COPY1]]
31 ; CHECK-NEXT: dead $xzr = SUBSXrr [[ADDXrr1]], [[COPY1]], implicit-def $nzcv
32 ; CHECK-NEXT: [[CSINCXr2:%[0-9]+]]:gpr64common = CSINCXr [[CSINCXr1]], [[CSINCXr1]], 1, implicit $nzcv
33 ; CHECK-NEXT: [[ADDXrr2:%[0-9]+]]:gpr64 = ADDXrr [[ADDXrr1]], [[COPY1]]
34 ; CHECK-NEXT: dead $xzr = SUBSXrr [[ADDXrr2]], [[COPY1]], implicit-def $nzcv
35 ; CHECK-NEXT: [[CSINCXr3:%[0-9]+]]:gpr64common = CSINCXr [[CSINCXr2]], [[CSINCXr2]], 1, implicit $nzcv
36 ; CHECK-NEXT: dead $xzr = SUBSXri [[CSINCXr3]], 0, 0, implicit-def $nzcv
37 ; CHECK-NEXT: Bcc 0, %bb.4, implicit $nzcv
41 ; CHECK-NEXT: successors: %bb.5(0x80000000)
43 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:gpr64 = COPY [[COPY1]]
44 ; CHECK-NEXT: [[FADDDrr:%[0-9]+]]:fpr64 = FADDDrr [[FMOVDi]], [[FMOVDi]], implicit $fpcr
45 ; CHECK-NEXT: [[ADDXrr3:%[0-9]+]]:gpr64 = ADDXrr [[COPY2]], [[COPY1]]
46 ; CHECK-NEXT: dead $xzr = SUBSXrr [[COPY2]], [[COPY1]], implicit-def $nzcv
47 ; CHECK-NEXT: [[COPY3:%[0-9]+]]:gpr64sp = COPY [[ADDXrr3]]
48 ; CHECK-NEXT: [[FADDDrr1:%[0-9]+]]:fpr64 = FADDDrr [[FADDDrr]], [[FMOVDi]], implicit $fpcr
51 ; CHECK-NEXT: successors: %bb.5(0x40000000), %bb.6(0x40000000)
53 ; CHECK-NEXT: [[PHI:%[0-9]+]]:fpr64 = PHI [[FADDDrr5:%[0-9]+]], %bb.5, [[FMOVDi]], %bb.4
54 ; CHECK-NEXT: [[PHI1:%[0-9]+]]:gpr64sp = PHI [[COPY7:%[0-9]+]], %bb.5, [[COPY1]], %bb.4
55 ; CHECK-NEXT: [[PHI2:%[0-9]+]]:gpr64 = PHI [[COPY8:%[0-9]+]], %bb.5, [[COPY2]], %bb.4
56 ; CHECK-NEXT: [[PHI3:%[0-9]+]]:fpr64 = PHI [[FADDDrr8:%[0-9]+]], %bb.5, [[FADDDrr]], %bb.4
57 ; CHECK-NEXT: [[PHI4:%[0-9]+]]:gpr64 = PHI [[ADDXrr6:%[0-9]+]], %bb.5, [[ADDXrr3]], %bb.4
58 ; CHECK-NEXT: [[PHI5:%[0-9]+]]:gpr64sp = PHI [[COPY9:%[0-9]+]], %bb.5, [[COPY3]], %bb.4
59 ; CHECK-NEXT: [[PHI6:%[0-9]+]]:fpr64 = PHI [[FADDDrr10:%[0-9]+]], %bb.5, [[FADDDrr1]], %bb.4
60 ; CHECK-NEXT: [[COPY4:%[0-9]+]]:gpr64 = COPY [[PHI5]]
61 ; CHECK-NEXT: [[FADDDrr2:%[0-9]+]]:fpr64 = FADDDrr [[FMOVDi]], [[PHI3]], implicit $fpcr
62 ; CHECK-NEXT: [[FADDDrr3:%[0-9]+]]:fpr64 = FADDDrr [[PHI6]], [[PHI]], implicit $fpcr
63 ; CHECK-NEXT: [[ADDXrr4:%[0-9]+]]:gpr64 = ADDXrr [[COPY4]], [[COPY1]]
64 ; CHECK-NEXT: dead $xzr = SUBSXrr [[COPY4]], [[COPY1]], implicit-def $nzcv
65 ; CHECK-NEXT: [[COPY5:%[0-9]+]]:gpr64sp = COPY [[ADDXrr4]]
66 ; CHECK-NEXT: [[FADDDrr4:%[0-9]+]]:fpr64 = FADDDrr [[FADDDrr2]], [[PHI3]], implicit $fpcr
67 ; CHECK-NEXT: [[COPY6:%[0-9]+]]:gpr64 = COPY [[COPY5]]
68 ; CHECK-NEXT: [[FADDDrr5]]:fpr64 = FADDDrr [[FMOVDi]], [[FADDDrr2]], implicit $fpcr
69 ; CHECK-NEXT: [[FADDDrr6:%[0-9]+]]:fpr64 = FADDDrr [[FADDDrr4]], [[PHI3]], implicit $fpcr
70 ; CHECK-NEXT: [[ADDXrr5:%[0-9]+]]:gpr64 = ADDXrr [[COPY6]], [[COPY1]]
71 ; CHECK-NEXT: dead $xzr = SUBSXrr [[COPY6]], [[COPY1]], implicit-def $nzcv
72 ; CHECK-NEXT: [[COPY7]]:gpr64sp = COPY [[ADDXrr5]]
73 ; CHECK-NEXT: [[FADDDrr7:%[0-9]+]]:fpr64 = FADDDrr [[FADDDrr5]], [[FADDDrr2]], implicit $fpcr
74 ; CHECK-NEXT: [[COPY8]]:gpr64 = COPY [[COPY7]]
75 ; CHECK-NEXT: [[FADDDrr8]]:fpr64 = FADDDrr [[FMOVDi]], [[FADDDrr5]], implicit $fpcr
76 ; CHECK-NEXT: [[FADDDrr9:%[0-9]+]]:fpr64 = FADDDrr [[FADDDrr7]], [[FADDDrr2]], implicit $fpcr
77 ; CHECK-NEXT: [[ADDXrr6]]:gpr64 = ADDXrr [[COPY8]], [[COPY1]]
78 ; CHECK-NEXT: dead $xzr = SUBSXrr [[COPY8]], [[COPY1]], implicit-def $nzcv
79 ; CHECK-NEXT: [[COPY9]]:gpr64sp = COPY [[ADDXrr6]]
80 ; CHECK-NEXT: [[FADDDrr10]]:fpr64 = FADDDrr [[FADDDrr8]], [[FADDDrr5]], implicit $fpcr
81 ; CHECK-NEXT: [[CSINCXr4:%[0-9]+]]:gpr64common = CSINCXr $xzr, $xzr, 1, implicit $nzcv
82 ; CHECK-NEXT: dead $xzr = SUBSXrr [[ADDXrr6]], [[COPY1]], implicit-def $nzcv
83 ; CHECK-NEXT: [[CSINCXr5:%[0-9]+]]:gpr64common = CSINCXr [[CSINCXr4]], [[CSINCXr4]], 1, implicit $nzcv
84 ; CHECK-NEXT: [[ADDXrr7:%[0-9]+]]:gpr64 = ADDXrr [[ADDXrr6]], [[COPY1]]
85 ; CHECK-NEXT: dead $xzr = SUBSXrr [[ADDXrr7]], [[COPY1]], implicit-def $nzcv
86 ; CHECK-NEXT: [[CSINCXr6:%[0-9]+]]:gpr64common = CSINCXr [[CSINCXr5]], [[CSINCXr5]], 1, implicit $nzcv
87 ; CHECK-NEXT: dead $xzr = SUBSXri [[CSINCXr6]], 0, 0, implicit-def $nzcv
88 ; CHECK-NEXT: Bcc 0, %bb.5, implicit $nzcv
92 ; CHECK-NEXT: successors: %bb.7(0x40000000), %bb.2(0x40000000)
94 ; CHECK-NEXT: [[FADDDrr11:%[0-9]+]]:fpr64 = FADDDrr [[FADDDrr10]], [[FADDDrr5]], implicit $fpcr
95 ; CHECK-NEXT: dead $xzr = SUBSXrr [[COPY8]], [[COPY1]], implicit-def $nzcv
96 ; CHECK-NEXT: [[CSINCXr7:%[0-9]+]]:gpr64common = CSINCXr $xzr, $xzr, 1, implicit $nzcv
97 ; CHECK-NEXT: dead $xzr = SUBSXri [[CSINCXr7]], 0, 0, implicit-def $nzcv
98 ; CHECK-NEXT: Bcc 0, %bb.7, implicit $nzcv
102 ; CHECK-NEXT: successors: %bb.1(0x80000000)
104 ; CHECK-NEXT: [[PHI7:%[0-9]+]]:fpr64 = PHI [[FMOVDi]], %bb.3, [[FADDDrr8]], %bb.6
105 ; CHECK-NEXT: [[PHI8:%[0-9]+]]:gpr64common = PHI [[COPY1]], %bb.3, [[COPY9]], %bb.6
106 ; CHECK-NEXT: B %bb.1
109 ; CHECK-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
111 ; CHECK-NEXT: [[PHI9:%[0-9]+]]:gpr64sp = PHI [[COPY11:%[0-9]+]]8, %bb.7, [[COPY11]], %bb.1
112 ; CHECK-NEXT: [[PHI10:%[0-9]+]]:fpr64 = PHI [[PHI7]], %bb.7, [[FADDDrr12:%[0-9]+]], %bb.1
113 ; CHECK-NEXT: [[COPY10:%[0-9]+]]:gpr64 = COPY [[PHI9]]
114 ; CHECK-NEXT: dead $xzr = SUBSXrr [[COPY10]], [[COPY1]], implicit-def $nzcv
115 ; CHECK-NEXT: [[ADDXrr8:%[0-9]+]]:gpr64 = ADDXrr [[COPY10]], [[COPY1]]
116 ; CHECK-NEXT: [[COPY11]]:gpr64sp = COPY [[ADDXrr8]]
117 ; CHECK-NEXT: [[FADDDrr12]]:fpr64 = FADDDrr [[FMOVDi]], [[PHI10]], implicit $fpcr
118 ; CHECK-NEXT: [[FADDDrr13:%[0-9]+]]:fpr64 = FADDDrr [[FADDDrr12]], [[PHI10]], implicit $fpcr
119 ; CHECK-NEXT: [[FADDDrr14:%[0-9]+]]:fpr64 = FADDDrr [[FADDDrr13]], [[PHI10]], implicit $fpcr
120 ; CHECK-NEXT: Bcc 1, %bb.1, implicit $nzcv
121 ; CHECK-NEXT: B %bb.2
124 ; CHECK-NEXT: [[PHI11:%[0-9]+]]:fpr64 = PHI [[FADDDrr12]], %bb.1, [[FADDDrr8]], %bb.6
125 ; CHECK-NEXT: [[PHI12:%[0-9]+]]:fpr64 = PHI [[FADDDrr14]], %bb.1, [[FADDDrr11]], %bb.6
126 ; CHECK-NEXT: [[FMULDrr:%[0-9]+]]:fpr64 = FMULDrr [[PHI11]], [[PHI12]], implicit $fpcr
127 ; CHECK-NEXT: $d0 = COPY [[FMULDrr]]
128 ; CHECK-NEXT: RET_ReallyLR implicit $d0
136 %12:gpr64sp = PHI %11, %bb.0, %15, %bb.1
137 %24:fpr64 = PHI %20, %bb.0, %21, %bb.1
139 dead $xzr = SUBSXrr %14, %11, implicit-def $nzcv
140 %13:gpr64 = ADDXrr %14, %11
141 %15:gpr64sp = COPY %13
142 %21:fpr64 = FADDDrr %20, %24, implicit $fpcr
143 %22:fpr64 = FADDDrr %21, %24, implicit $fpcr
144 %23:fpr64 = FADDDrr %22, %24, implicit $fpcr
145 Bcc 1, %bb.1, implicit $nzcv
149 %25:fpr64 = FMULDrr %21, %23, implicit $fpcr
151 RET_ReallyLR implicit $d0