2020-03-30 06:35:38 +08:00
|
|
|
// RUN: mlir-opt -allow-unregistered-dialect -print-op-stats %s -o=/dev/null 2>&1 | FileCheck %s
|
2018-11-21 01:38:15 +08:00
|
|
|
|
2019-01-03 02:20:00 +08:00
|
|
|
func @main(tensor<4xf32>, tensor<4xf32>) -> tensor<4xf32> {
|
2018-12-30 03:32:37 +08:00
|
|
|
^bb0(%arg0: tensor<4xf32>, %arg1: tensor<4xf32>):
|
2018-11-21 01:38:15 +08:00
|
|
|
%0 = addf %arg0, %arg1 : tensor<4xf32>
|
|
|
|
%1 = addf %arg0, %arg1 : tensor<4xf32>
|
|
|
|
%2 = addf %arg0, %arg1 : tensor<4xf32>
|
|
|
|
%3 = addf %arg0, %arg1 : tensor<4xf32>
|
|
|
|
%4 = addf %arg0, %arg1 : tensor<4xf32>
|
|
|
|
%5 = addf %arg0, %arg1 : tensor<4xf32>
|
|
|
|
%10 = "xla.add"(%0, %arg1) : (tensor<4xf32>,tensor<4xf32>)-> tensor<4xf32>
|
|
|
|
%11 = "xla.add"(%0, %arg1) : (tensor<4xf32>,tensor<4xf32>)-> tensor<4xf32>
|
|
|
|
%12 = "xla.add"(%0, %arg1) : (tensor<4xf32>,tensor<4xf32>)-> tensor<4xf32>
|
|
|
|
%13 = "xla.add"(%0, %arg1) : (tensor<4xf32>,tensor<4xf32>)-> tensor<4xf32>
|
|
|
|
%14 = "xla.add"(%0, %arg1) : (tensor<4xf32>,tensor<4xf32>)-> tensor<4xf32>
|
|
|
|
%15 = "xla.add"(%0, %arg1) : (tensor<4xf32>,tensor<4xf32>)-> tensor<4xf32>
|
|
|
|
%16 = "xla.add"(%0, %arg1) : (tensor<4xf32>,tensor<4xf32>)-> tensor<4xf32>
|
|
|
|
%17 = "xla.add"(%0, %arg1) : (tensor<4xf32>,tensor<4xf32>)-> tensor<4xf32>
|
|
|
|
%18 = "xla.add"(%0, %arg1) : (tensor<4xf32>,tensor<4xf32>)-> tensor<4xf32>
|
|
|
|
%19 = "xla.add"(%0, %arg1) : (tensor<4xf32>,tensor<4xf32>)-> tensor<4xf32>
|
|
|
|
%20 = "xla.add"(%0, %arg1) : (tensor<4xf32>,tensor<4xf32>)-> tensor<4xf32>
|
|
|
|
%21 = "xla.add"(%0, %arg1) : (tensor<4xf32>,tensor<4xf32>)-> tensor<4xf32>
|
|
|
|
%22 = "xla.add"(%0, %arg1) : (tensor<4xf32>,tensor<4xf32>)-> tensor<4xf32>
|
|
|
|
%23 = "xla.add"(%0, %arg1) : (tensor<4xf32>,tensor<4xf32>)-> tensor<4xf32>
|
|
|
|
%24 = "xla.add"(%0, %arg1) : (tensor<4xf32>,tensor<4xf32>)-> tensor<4xf32>
|
|
|
|
%25 = "xla.add"(%0, %arg1) : (tensor<4xf32>,tensor<4xf32>)-> tensor<4xf32>
|
|
|
|
%26 = "xla.add"(%0, %arg1) : (tensor<4xf32>,tensor<4xf32>)-> tensor<4xf32>
|
|
|
|
%30 = "long_op_name"(%0, %arg1) : (tensor<4xf32>,tensor<4xf32>)-> tensor<4xf32>
|
|
|
|
return %1 : tensor<4xf32>
|
|
|
|
}
|
|
|
|
|
|
|
|
// CHECK-LABEL: Operations encountered
|
Rewrite OpStats to use llvm formatting utilities.
Example Output:
Operations encountered:
-----------------------
addf , 11
constant , 4
return , 19
some_op , 1
tf.AvgPool , 3
tf.DepthwiseConv2dNative , 3
tf.FusedBatchNorm , 2
tfl.add , 7
tfl.average_pool_2d , 1
tfl.leaky_relu , 1
PiperOrigin-RevId: 229937190
2019-01-19 01:00:34 +08:00
|
|
|
// CHECK: long_op_name , 1
|
2019-03-03 10:03:03 +08:00
|
|
|
// CHECK: std.addf , 6
|
|
|
|
// CHECK: std.return , 1
|
Rewrite OpStats to use llvm formatting utilities.
Example Output:
Operations encountered:
-----------------------
addf , 11
constant , 4
return , 19
some_op , 1
tf.AvgPool , 3
tf.DepthwiseConv2dNative , 3
tf.FusedBatchNorm , 2
tfl.add , 7
tfl.average_pool_2d , 1
tfl.leaky_relu , 1
PiperOrigin-RevId: 229937190
2019-01-19 01:00:34 +08:00
|
|
|
// CHECK: xla.add , 17
|