llvm/mlir/utils
Tim Shen 25b3806788 [MLIR] Rework generate-test-checks.py to attach CHECK lines to the source (test) file.
Summary:
This patch adds --source flag to indicate the source file. Then it tries to find insert
points in the source file and insert corresponding checks at those places.

Example output from Tensorflow XLA:

// -----

// CHECK-LABEL:   func @main.3(
// CHECK-SAME:                 %[[VAL_0:.*]]: memref<2x2xf32> {xla_lhlo.params = 0 : index},
// CHECK-SAME:                 %[[VAL_1:.*]]: memref<16xi8> {xla_lhlo.alloc = 0 : index, xla_lhlo.liveout = true}) {
// CHECK:           %[[VAL_2:.*]] = constant 0 : index
// CHECK:           %[[VAL_3:.*]] = constant 0 : index
// CHECK:           %[[VAL_4:.*]] = std.view %[[VAL_1]]{{\[}}%[[VAL_3]]][] : memref<16xi8> to memref<2x2xf32>
// CHECK:           "xla_lhlo.tanh"(%[[VAL_0]], %[[VAL_4]]) : (memref<2x2xf32>, memref<2x2xf32>) -> ()
// CHECK:           return
// CHECK:         }
func @main(%value0: tensor<2x2xf32>) -> tensor<2x2xf32> {
  %res = "xla_hlo.tanh"(%value0) : (tensor<2x2xf32>) -> tensor<2x2xf32>
  return %res : tensor<2x2xf32>
}

Differential Revision: https://reviews.llvm.org/D81903
2020-06-16 11:15:46 -07:00
..
emacs
spirv [mlir][spirv] NFC: use Optional to replace SPV_Optional 2020-04-13 15:44:06 -04:00
textmate
vim [MLIR][NFC] Update vim syntax file 2020-06-14 18:03:26 +05:30
generate-test-checks.py [MLIR] Rework generate-test-checks.py to attach CHECK lines to the source (test) file. 2020-06-16 11:15:46 -07:00