`mlir-translate` tool `-dot-cfg-mssa` option

Hi~ :innocent: I come across about one conversion problem when applying mlir-translate tool. I intend to print dot format text from high-level affine based IR
Here is input text:

module attributes {torch.debug_module_name = "MatMulModule"} {
  func.func @forward(%arg0: memref<3x3xf32>, %arg1: memref<3x3xf32>, %arg2: memref<3x3xf32>) {
    %cst = arith.constant 0.000000e+00 : f32
    %alloc = memref.alloc() {alignment = 64 : i64} : memref<3x3xf32>
    affine.for %arg3 = 0 to 3 {
      affine.for %arg4 = 0 to 3 {
        affine.store %cst, %alloc[%arg3, %arg4] : memref<3x3xf32>
      }
    }
    %alloc_0 = memref.alloc() {alignment = 64 : i64} : memref<3x3xf32>
    memref.copy %alloc, %alloc_0 : memref<3x3xf32> to memref<3x3xf32>
    memref.dealloc %alloc : memref<3x3xf32>
    affine.for %arg3 = 0 to 3 {
      affine.for %arg4 = 0 to 3 {
        affine.for %arg5 = 0 to 3 {
          %0 = affine.load %arg0[%arg3, %arg5] : memref<3x3xf32>
          %1 = affine.load %arg1[%arg5, %arg4] : memref<3x3xf32>
          %2 = affine.load %alloc_0[%arg3, %arg4] : memref<3x3xf32>
          %3 = arith.mulf %0, %1 : f32
          %4 = arith.addf %2, %3 : f32
          affine.store %4, %alloc_0[%arg3, %arg4] : memref<3x3xf32>
        }
      }
    }
    memref.copy %alloc_0, %arg2 : memref<3x3xf32> to memref<3x3xf32>
    return
  }
}

After I run the following command mlir-opt test.mlir --one-shot-bufferize='bufferize-function-boundaries' -test-lower-to-llvm | mlir-translate -dot-cfg-mssa="matrix_mulitiplication_2.2.dot"
Console emits some error log

Translations to perform option: must be specified at least once!
Translations to perform option: must be specified at least once!
Translations to perform option: must be specified at least once!
Translations to perform option: must be specified at least once!
Translations to perform option: must be specified at least once!
Translations to perform option: must be specified at least once!
Translations to perform option: must be specified at least once!
Translations to perform option: must be specified at least once!

I barely have any idea about where is incorrect? :sob: :sob:

dot-cfg-mssa is not an option for MLIR or mlir-translate this is a LLVM analysis option.
It can run with opt on some piece of LLVM IR like this: opt -aa-pipeline=basic-aa -passes='print<memoryssa>' -dot-cfg-mssa=out.dot

1 Like

:ok_hand: Thank you so much for your fast reply, I will check it right now~

Unfortunately, there is a critical error in console :sob: :joy:

opt: <stdin>:1:8: error: expected 'module asm'
module attributes {torch.debug_module_name = "MatMulModule"} {

Are you passing an MLIR file to LLVM?

Sorry, I have input the wrong format file :sob: now is working~ thank you so much :smiling_face_with_three_hearts: