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=4 -mcpu=neoverse-n1 2>&1 | FileCheck %s
4 # test pipeliner code genearation by MVE algorithm
5 # #stages: 2, unroll count: 2
10 tracksRegLiveness: true
12 ; CHECK-LABEL: name: func
14 ; CHECK-NEXT: successors: %bb.3(0x80000000)
15 ; CHECK-NEXT: liveins: $x0, $x1
17 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr64 = COPY $x0
18 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:gpr64 = COPY $x1
19 ; CHECK-NEXT: [[FMOVDi:%[0-9]+]]:fpr64 = FMOVDi 1
23 ; CHECK-NEXT: successors: %bb.4(0x40000000), %bb.7(0x40000000)
25 ; CHECK-NEXT: [[ADDXrr:%[0-9]+]]:gpr64 = ADDXrr [[COPY1]], [[COPY1]]
26 ; CHECK-NEXT: dead $xzr = SUBSXrr [[COPY]], [[ADDXrr]], implicit-def $nzcv
27 ; CHECK-NEXT: [[CSINCXr:%[0-9]+]]:gpr64common = CSINCXr $xzr, $xzr, 1, implicit $nzcv
28 ; CHECK-NEXT: [[ADDXrr1:%[0-9]+]]:gpr64 = ADDXrr [[ADDXrr]], [[COPY1]]
29 ; CHECK-NEXT: dead $xzr = SUBSXrr [[COPY]], [[ADDXrr1]], implicit-def $nzcv
30 ; CHECK-NEXT: [[CSINCXr1:%[0-9]+]]:gpr64common = CSINCXr [[CSINCXr]], [[CSINCXr]], 1, implicit $nzcv
31 ; CHECK-NEXT: [[ADDXrr2:%[0-9]+]]:gpr64 = ADDXrr [[ADDXrr1]], [[COPY1]]
32 ; CHECK-NEXT: dead $xzr = SUBSXrr [[COPY]], [[ADDXrr2]], implicit-def $nzcv
33 ; CHECK-NEXT: [[CSINCXr2:%[0-9]+]]:gpr64common = CSINCXr [[CSINCXr1]], [[CSINCXr1]], 1, implicit $nzcv
34 ; CHECK-NEXT: dead $xzr = SUBSXri [[CSINCXr2]], 0, 0, implicit-def $nzcv
35 ; CHECK-NEXT: Bcc 0, %bb.4, implicit $nzcv
39 ; CHECK-NEXT: successors: %bb.5(0x80000000)
41 ; CHECK-NEXT: [[FADDDrr:%[0-9]+]]:fpr64 = FADDDrr [[FMOVDi]], [[FMOVDi]], implicit $fpcr
42 ; CHECK-NEXT: [[ADDXrr3:%[0-9]+]]:gpr64 = ADDXrr [[COPY1]], [[COPY1]]
43 ; CHECK-NEXT: dead $xzr = SUBSXrr [[COPY]], [[ADDXrr3]], implicit-def $nzcv
44 ; CHECK-NEXT: [[FADDDrr1:%[0-9]+]]:fpr64 = FADDDrr [[FADDDrr]], [[FMOVDi]], implicit $fpcr
47 ; CHECK-NEXT: successors: %bb.5(0x40000000), %bb.6(0x40000000)
49 ; CHECK-NEXT: [[PHI:%[0-9]+]]:fpr64 = PHI [[FADDDrr3:%[0-9]+]], %bb.5, [[FMOVDi]], %bb.4
50 ; CHECK-NEXT: [[PHI1:%[0-9]+]]:gpr64 = PHI [[ADDXrr4:%[0-9]+]], %bb.5, [[COPY1]], %bb.4
51 ; CHECK-NEXT: [[PHI2:%[0-9]+]]:fpr64 = PHI [[FADDDrr6:%[0-9]+]], %bb.5, [[FADDDrr]], %bb.4
52 ; CHECK-NEXT: [[PHI3:%[0-9]+]]:gpr64 = PHI [[ADDXrr5:%[0-9]+]], %bb.5, [[ADDXrr3]], %bb.4
53 ; CHECK-NEXT: [[PHI4:%[0-9]+]]:fpr64 = PHI [[FADDDrr7:%[0-9]+]], %bb.5, [[FADDDrr1]], %bb.4
54 ; CHECK-NEXT: [[FADDDrr2:%[0-9]+]]:fpr64 = FADDDrr [[PHI4]], [[PHI]], implicit $fpcr
55 ; CHECK-NEXT: [[FADDDrr3]]:fpr64 = FADDDrr [[FMOVDi]], [[PHI2]], implicit $fpcr
56 ; CHECK-NEXT: [[ADDXrr4]]:gpr64 = ADDXrr [[PHI3]], [[COPY1]]
57 ; CHECK-NEXT: dead $xzr = SUBSXrr [[COPY]], [[ADDXrr4]], implicit-def $nzcv
58 ; CHECK-NEXT: [[FADDDrr4:%[0-9]+]]:fpr64 = FADDDrr [[FADDDrr3]], [[PHI2]], implicit $fpcr
59 ; CHECK-NEXT: [[FADDDrr5:%[0-9]+]]:fpr64 = FADDDrr [[FADDDrr4]], [[PHI2]], implicit $fpcr
60 ; CHECK-NEXT: [[FADDDrr6]]:fpr64 = FADDDrr [[FMOVDi]], [[FADDDrr3]], implicit $fpcr
61 ; CHECK-NEXT: [[ADDXrr5]]:gpr64 = ADDXrr [[ADDXrr4]], [[COPY1]]
62 ; CHECK-NEXT: dead $xzr = SUBSXrr [[COPY]], [[ADDXrr5]], implicit-def $nzcv
63 ; CHECK-NEXT: [[FADDDrr7]]:fpr64 = FADDDrr [[FADDDrr6]], [[FADDDrr3]], implicit $fpcr
64 ; CHECK-NEXT: [[CSINCXr3:%[0-9]+]]:gpr64common = CSINCXr $xzr, $xzr, 1, implicit $nzcv
65 ; CHECK-NEXT: [[ADDXrr6:%[0-9]+]]:gpr64 = ADDXrr [[ADDXrr5]], [[COPY1]]
66 ; CHECK-NEXT: dead $xzr = SUBSXrr [[COPY]], [[ADDXrr6]], implicit-def $nzcv
67 ; CHECK-NEXT: [[CSINCXr4:%[0-9]+]]:gpr64common = CSINCXr [[CSINCXr3]], [[CSINCXr3]], 1, implicit $nzcv
68 ; CHECK-NEXT: dead $xzr = SUBSXri [[CSINCXr4]], 0, 0, implicit-def $nzcv
69 ; CHECK-NEXT: Bcc 0, %bb.5, implicit $nzcv
73 ; CHECK-NEXT: successors: %bb.7(0x40000000), %bb.2(0x40000000)
75 ; CHECK-NEXT: [[FADDDrr8:%[0-9]+]]:fpr64 = FADDDrr [[FADDDrr7]], [[FADDDrr3]], implicit $fpcr
76 ; CHECK-NEXT: dead $xzr = SUBSXrr [[COPY]], [[ADDXrr5]], implicit-def $nzcv
77 ; CHECK-NEXT: [[CSINCXr5:%[0-9]+]]:gpr64common = CSINCXr $xzr, $xzr, 1, implicit $nzcv
78 ; CHECK-NEXT: dead $xzr = SUBSXri [[CSINCXr5]], 0, 0, implicit-def $nzcv
79 ; CHECK-NEXT: Bcc 0, %bb.7, implicit $nzcv
83 ; CHECK-NEXT: successors: %bb.1(0x80000000)
85 ; CHECK-NEXT: [[PHI5:%[0-9]+]]:fpr64 = PHI [[FMOVDi]], %bb.3, [[FADDDrr6]], %bb.6
86 ; CHECK-NEXT: [[PHI6:%[0-9]+]]:gpr64 = PHI [[COPY1]], %bb.3, [[ADDXrr5]], %bb.6
90 ; CHECK-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
92 ; CHECK-NEXT: [[PHI7:%[0-9]+]]:gpr64 = PHI [[PHI6]], %bb.7, [[ADDXrr7:%[0-9]+]], %bb.1
93 ; CHECK-NEXT: [[PHI8:%[0-9]+]]:fpr64 = PHI [[PHI5]], %bb.7, [[FADDDrr9:%[0-9]+]], %bb.1
94 ; CHECK-NEXT: [[ADDXrr7]]:gpr64 = ADDXrr [[PHI7]], [[COPY1]]
95 ; CHECK-NEXT: dead $xzr = SUBSXrr [[COPY]], [[ADDXrr7]], implicit-def $nzcv
96 ; CHECK-NEXT: [[FADDDrr9]]:fpr64 = FADDDrr [[FMOVDi]], [[PHI8]], implicit $fpcr
97 ; CHECK-NEXT: [[FADDDrr10:%[0-9]+]]:fpr64 = FADDDrr [[FADDDrr9]], [[PHI8]], implicit $fpcr
98 ; CHECK-NEXT: [[FADDDrr11:%[0-9]+]]:fpr64 = FADDDrr [[FADDDrr10]], [[PHI8]], implicit $fpcr
99 ; CHECK-NEXT: Bcc 1, %bb.1, implicit $nzcv
100 ; CHECK-NEXT: B %bb.2
103 ; CHECK-NEXT: [[PHI9:%[0-9]+]]:fpr64 = PHI [[FADDDrr9]], %bb.1, [[FADDDrr6]], %bb.6
104 ; CHECK-NEXT: [[PHI10:%[0-9]+]]:fpr64 = PHI [[FADDDrr11]], %bb.1, [[FADDDrr8]], %bb.6
105 ; CHECK-NEXT: [[FMULDrr:%[0-9]+]]:fpr64 = FMULDrr [[PHI9]], [[PHI10]], implicit $fpcr
106 ; CHECK-NEXT: $d0 = COPY [[FMULDrr]]
107 ; CHECK-NEXT: RET_ReallyLR implicit $d0
115 %12:gpr64 = PHI %11, %bb.0, %13, %bb.1
116 %24:fpr64 = PHI %20, %bb.0, %21, %bb.1
117 %13:gpr64 = ADDXrr %12, %11
118 dead $xzr = SUBSXrr %10, %13, implicit-def $nzcv
119 %21:fpr64 = FADDDrr %20, %24, implicit $fpcr
120 %22:fpr64 = FADDDrr %21, %24, implicit $fpcr
121 %23:fpr64 = FADDDrr %22, %24, implicit $fpcr
122 Bcc 1, %bb.1, implicit $nzcv
126 %25:fpr64 = FMULDrr %21, %23, implicit $fpcr
128 RET_ReallyLR implicit $d0