1# RUN: llc -run-pass=machine-combiner -o - -mtriple=aarch64-unknown-linux -mcpu=cortex-a57 -enable-unsafe-fp-math -machine-combiner-verify-pattern-order=true %s | FileCheck --check-prefixes=UNPROFITABLE,ALL %s 2# RUN: llc -run-pass=machine-combiner -o - -mtriple=aarch64-unknown-linux -mcpu=falkor -enable-unsafe-fp-math %s -machine-combiner-verify-pattern-order=true | FileCheck --check-prefixes=PROFITABLE,ALL %s 3# RUN: llc -run-pass=machine-combiner -o - -mtriple=aarch64-unknown-linux -mcpu=exynos-m1 -enable-unsafe-fp-math -machine-combiner-verify-pattern-order=true %s | FileCheck --check-prefixes=PROFITABLE,ALL %s 4# RUN: llc -run-pass=machine-combiner -o - -mtriple=aarch64-unknown-linux -mcpu=thunderx2t99 -enable-unsafe-fp-math -machine-combiner-verify-pattern-order=true %s | FileCheck --check-prefixes=PROFITABLE,ALL %s 5# 6name: f1_2s 7registers: 8 - { id: 0, class: fpr64 } 9 - { id: 1, class: fpr64 } 10 - { id: 2, class: fpr64 } 11 - { id: 3, class: fpr64 } 12 - { id: 4, class: fpr64 } 13body: | 14 bb.0.entry: 15 %2:fpr64 = COPY $d2 16 %1:fpr64 = COPY $d1 17 %0:fpr64 = COPY $d0 18 %3:fpr64 = FMULv2f32 %0, %1 19 %4:fpr64 = FSUBv2f32 killed %3, %2 20 $d0 = COPY %4 21 RET_ReallyLR implicit $d0 22 23... 24# UNPROFITABLE-LABEL: name: f1_2s 25# UNPROFITABLE: %3:fpr64 = FMULv2f32 %0, %1 26# UNPROFITABLE-NEXT: FSUBv2f32 killed %3, %2 27# 28# PROFITABLE-LABEL: name: f1_2s 29# PROFITABLE: [[R1:%[0-9]+]]:fpr64 = FNEGv2f32 %2 30# PROFITABLE-NEXT: FMLAv2f32 killed [[R1]], %0, %1 31--- 32name: f1_4s 33registers: 34 - { id: 0, class: fpr128 } 35 - { id: 1, class: fpr128 } 36 - { id: 2, class: fpr128 } 37 - { id: 3, class: fpr128 } 38 - { id: 4, class: fpr128 } 39body: | 40 bb.0.entry: 41 %2:fpr128 = COPY $q2 42 %1:fpr128 = COPY $q1 43 %0:fpr128 = COPY $q0 44 %3:fpr128 = FMULv4f32 %0, %1 45 %4:fpr128 = FSUBv4f32 killed %3, %2 46 $q0 = COPY %4 47 RET_ReallyLR implicit $q0 48 49... 50# UNPROFITABLE-LABEL: name: f1_4s 51# UNPROFITABLE: %3:fpr128 = FMULv4f32 %0, %1 52# UNPROFITABLE-NEXT: FSUBv4f32 killed %3, %2 53# 54# PROFITABLE-LABEL: name: f1_4s 55# PROFITABLE: [[R1:%[0-9]+]]:fpr128 = FNEGv4f32 %2 56# PROFITABLE-NEXT: FMLAv4f32 killed [[R1]], %0, %1 57--- 58name: f1_2d 59registers: 60 - { id: 0, class: fpr128 } 61 - { id: 1, class: fpr128 } 62 - { id: 2, class: fpr128 } 63 - { id: 3, class: fpr128 } 64 - { id: 4, class: fpr128 } 65body: | 66 bb.0.entry: 67 %2:fpr128 = COPY $q2 68 %1:fpr128 = COPY $q1 69 %0:fpr128 = COPY $q0 70 %3:fpr128 = FMULv2f64 %0, %1 71 %4:fpr128 = FSUBv2f64 killed %3, %2 72 $q0 = COPY %4 73 RET_ReallyLR implicit $q0 74 75... 76# UNPROFITABLE-LABEL: name: f1_2d 77# UNPROFITABLE: %3:fpr128 = FMULv2f64 %0, %1 78# UNPROFITABLE-NEXT: FSUBv2f64 killed %3, %2 79# 80# PROFITABLE-LABEL: name: f1_2d 81# PROFITABLE: [[R1:%[0-9]+]]:fpr128 = FNEGv2f64 %2 82# PROFITABLE-NEXT: FMLAv2f64 killed [[R1]], %0, %1 83--- 84name: f1_both_fmul_2s 85registers: 86 - { id: 0, class: fpr64 } 87 - { id: 1, class: fpr64 } 88 - { id: 2, class: fpr64 } 89 - { id: 3, class: fpr64 } 90 - { id: 4, class: fpr64 } 91 - { id: 5, class: fpr64 } 92 - { id: 6, class: fpr64 } 93body: | 94 bb.0.entry: 95 %3:fpr64 = COPY $q3 96 %2:fpr64 = COPY $q2 97 %1:fpr64 = COPY $q1 98 %0:fpr64 = COPY $q0 99 %4:fpr64 = FMULv2f32 %0, %1 100 %5:fpr64 = FMULv2f32 %2, %3 101 %6:fpr64 = FSUBv2f32 killed %4, %5 102 $q0 = COPY %6 103 RET_ReallyLR implicit $q0 104 105... 106# ALL-LABEL: name: f1_both_fmul_2s 107# ALL: %4:fpr64 = FMULv2f32 %0, %1 108# ALL-NEXT: FMLSv2f32 killed %4, %2, %3 109--- 110name: f1_both_fmul_4s 111registers: 112 - { id: 0, class: fpr128 } 113 - { id: 1, class: fpr128 } 114 - { id: 2, class: fpr128 } 115 - { id: 3, class: fpr128 } 116 - { id: 4, class: fpr128 } 117 - { id: 5, class: fpr128 } 118 - { id: 6, class: fpr128 } 119body: | 120 bb.0.entry: 121 %3:fpr128 = COPY $q3 122 %2:fpr128 = COPY $q2 123 %1:fpr128 = COPY $q1 124 %0:fpr128 = COPY $q0 125 %4:fpr128 = FMULv4f32 %0, %1 126 %5:fpr128 = FMULv4f32 %2, %3 127 %6:fpr128 = FSUBv4f32 killed %4, %5 128 $q0 = COPY %6 129 RET_ReallyLR implicit $q0 130 131... 132# ALL-LABEL: name: f1_both_fmul_4s 133# ALL: %4:fpr128 = FMULv4f32 %0, %1 134# ALL-NEXT: FMLSv4f32 killed %4, %2, %3 135--- 136name: f1_both_fmul_2d 137registers: 138 - { id: 0, class: fpr128 } 139 - { id: 1, class: fpr128 } 140 - { id: 2, class: fpr128 } 141 - { id: 3, class: fpr128 } 142 - { id: 4, class: fpr128 } 143 - { id: 5, class: fpr128 } 144 - { id: 6, class: fpr128 } 145body: | 146 bb.0.entry: 147 %3:fpr128 = COPY $q3 148 %2:fpr128 = COPY $q2 149 %1:fpr128 = COPY $q1 150 %0:fpr128 = COPY $q0 151 %4:fpr128 = FMULv2f64 %0, %1 152 %5:fpr128 = FMULv2f64 %2, %3 153 %6:fpr128 = FSUBv2f64 killed %4, %5 154 $q0 = COPY %6 155 RET_ReallyLR implicit $q0 156 157... 158# ALL-LABEL: name: f1_both_fmul_2d 159# ALL: %4:fpr128 = FMULv2f64 %0, %1 160# ALL-NEXT: FMLSv2f64 killed %4, %2, %3 161 162