brintos

brintos / llvm-project-archived public Read only

0
0
Text · 780 B · a783f65 Raw
20 lines · plain
1// RUN: mlir-query %s -c "m hasOpName(\"arith.mulf\").extract(\"testmul\")" | FileCheck %s2 3// CHECK: func.func @testmul({{.*}}) -> (f32, f32, f32) {4// CHECK:       %[[MUL0:.*]] = arith.mulf {{.*}} : f325// CHECK:       %[[MUL1:.*]] = arith.mulf {{.*}}, %[[MUL0]] : f326// CHECK:       %[[MUL2:.*]] = arith.mulf {{.*}} : f327// CHECK-NEXT:  return %[[MUL0]], %[[MUL1]], %[[MUL2]] : f32, f32, f328 9func.func @mixedOperations(%a: f32, %b: f32, %c: f32) -> f32 {10  %sum0 = arith.addf %a, %b : f3211  %sub0 = arith.subf %sum0, %c : f3212  %mul0 = arith.mulf %a, %sub0 : f3213  %sum1 = arith.addf %b, %c : f3214  %mul1 = arith.mulf %sum1, %mul0 : f3215  %sub2 = arith.subf %mul1, %a : f3216  %sum2 = arith.addf %mul1, %b : f3217  %mul2 = arith.mulf %sub2, %sum2 : f3218  return %mul2 : f3219}20