It sucks that I seem to be having problems again.It doesn’t look like it found the definition of the printf function.
ImplicitTypeIDRegistry::lookupOrInsert(mlir::detail::PreservedAnalyses::AllAnalysesType)
ImplicitTypeIDRegistry::lookupOrInsert(mlir::OpTrait::AtLeastNOperands<1>::Impl<mlir::TypeID::get() [with Trait = mlir::OpTrait::AtLeastNOperands<1>::Impl]::Empty>)
ImplicitTypeIDRegistry::lookupOrInsert(mlir::CallOpInterface::Trait<mlir::TypeID::get() [with Trait = mlir::CallOpInterface::Trait]::Empty>)
configSt.mlir:6:3: error: 'func.call' op 'printf' does not reference a valid function
gemmini.Print %arrayA : memref<16x16xi8>
^
configSt.mlir:6:3: note: see current operation: %27 = "func.call"(%9) {callee = @printf} : (!llvm.ptr<i8>) -> i32
mlir-asm-printer: Verifying operation: func.func
'scf.yield' op must be the last operation in the parent block
mlir-asm-printer: 'func.func' failed to verify and will be printed in generic form
"func.func"() ({
%0 = "arith.constant"() {value = 16 : i64} : () -> i64
%1 = "arith.constant"() {value = 0 : i64} : () -> i64
%2 = "memref.alloc"() {operand_segment_sizes = array<i32: 0, 0>} : () -> memref<16x16xi8>
%3 = "memref.alloc"() {operand_segment_sizes = array<i32: 0, 0>} : () -> memref<16x16xi8>
%4 = "llvm.mlir.addressof"() {global_name = @frmt_spec} : () -> !llvm.ptr<array<4 x i8>>
%5 = "llvm.mlir.constant"() {value = 0 : index} : () -> i64
%6 = "llvm.getelementptr"(%4, %5, %5) {rawConstantIndices = array<i32: -2147483648, -2147483648>} : (!llvm.ptr<array<4 x i8>>, i64, i64) -> !llvm.ptr<i8>
%7 = "llvm.mlir.addressof"() {global_name = @nl} : () -> !llvm.ptr<array<2 x i8>>
%8 = "llvm.mlir.constant"() {value = 0 : index} : () -> i64
%9 = "llvm.getelementptr"(%7, %8, %8) {rawConstantIndices = array<i32: -2147483648, -2147483648>} : (!llvm.ptr<array<2 x i8>>, i64, i64) -> !llvm.ptr<i8>
%10 = "arith.constant"() {value = 0 : index} : () -> index
%11 = "arith.constant"() {value = 16 : index} : () -> index
%12 = "arith.constant"() {value = 1 : index} : () -> index
"scf.for"(%10, %11, %12) ({
^bb0(%arg0: index):
%24 = "arith.constant"() {value = 0 : index} : () -> index
%25 = "arith.constant"() {value = 16 : index} : () -> index
%26 = "arith.constant"() {value = 1 : index} : () -> index
"scf.for"(%24, %25, %26) ({
^bb0(%arg1: index):
%28 = "memref.load"(%2, %arg0, %arg1) : (memref<16x16xi8>, index, index) -> i8
%29 = "func.call"(%6, %28) {callee = @printf} : (!llvm.ptr<i8>, i8) -> i32
"scf.yield"() : () -> ()
"scf.yield"() : () -> ()
}) : (index, index, index) -> ()
"scf.yield"() : () -> ()
%27 = "func.call"(%9) {callee = @printf} : (!llvm.ptr<i8>) -> i32
"scf.yield"() : () -> ()
}) : (index, index, index) -> ()
"gemmini.Print"(%2) : (memref<16x16xi8>) -> ()
%13 = "memref.cast"(%2) : (memref<16x16xi8>) -> memref<*xi8>
%14 = "memref.extract_aligned_pointer_as_index"(%2) : (memref<16x16xi8>) -> index
%15 = "arith.index_cast"(%14) : (index) -> i64
%16 = "memref.extract_aligned_pointer_as_index"(%3) : (memref<16x16xi8>) -> index
%17 = "arith.index_cast"(%16) : (index) -> i64
%18 = "arith.constant"() {value = 2 : i64} : () -> i64
%19 = "arith.constant"() {value = 4575657221408423952 : i64} : () -> i64
"gemmini.intr.configSt"(%18, %19) : (i64, i64) -> ()
"gemmini.ConfigSt"(%0) {activation = 0 : i64} : (i64) -> ()
%20 = "arith.constant"() {value = 4575657221409472769 : i64} : () -> i64
"gemmini.intr.configLd"(%20, %0) : (i64, i64) -> ()
"gemmini.ConfigLd"(%0) : (i64) -> ()
%21 = "arith.constant"() {value = 4503668346847232 : i64} : () -> i64
"gemmini.intr.mvin"(%15, %21) : (i64, i64) -> ()
"gemmini.Mvin"(%15, %1) : (i64, i64) -> ()
%22 = "memref.cast"(%3) : (memref<16x16xi8>) -> memref<*xi8>
%23 = "arith.constant"() {value = 4503668346847232 : i64} : () -> i64
"gemmini.intr.mvout"(%17, %23) : (i64, i64) -> ()
"gemmini.Mvout"(%17, %1) : (i64, i64) -> ()
"func.return"() : () -> ()
}) {function_type = () -> (), sym_name = "main"} : () -> ()
} -> SUCCESS
//===-------------------------------------------===//
//===-------------------------------------------===//
Legalizing operation : 'func.return'(0x5623b1b3b720) {
"func.return"() : () -> ()
} -> SUCCESS : operation marked legal by the target
//===-------------------------------------------===//
ImplicitTypeIDRegistry::lookupOrInsert(mlir::detail::PreservedAnalyses::AllAnalysesType)
ImplicitTypeIDRegistry::lookupOrInsert(mlir::OpTrait::AtLeastNOperands<1>::Impl<mlir::TypeID::get() [with Trait = mlir::OpTrait::AtLeastNOperands<1>::Impl]::Empty>)
ImplicitTypeIDRegistry::lookupOrInsert(mlir::CallOpInterface::Trait<mlir::TypeID::get() [with Trait = mlir::CallOpInterface::Trait]::Empty>)
configSt.mlir:6:3: error: 'func.call' op 'printf' does not reference a valid function
gemmini.Print %arrayA : memref<16x16xi8>
^
configSt.mlir:6:3: note: see current operation: %27 = "func.call"(%9) {callee = @printf} : (!llvm.ptr<i8>) -> i32