The following code is written in Pass, but when I run it, I get garbled code.I don’t know if this is a bug or maybe my code is not written correctly.If anyone can help me, I would appreciate it.Thanks!
auto loop = rewriter.create<scf::ForOp>(loc, lowerBound, batchSize, stride);
Value loopIdv = loop.getInductionVar();
rewriter.setInsertionPointToStart(loop.getBody());
ValueRange offsets = {loopIdv, constant0, constant0 };
ValueRange sizes = {stride, input0Row, input0Col };
ValueRange strides = {stride, stride, stride};
MemRefType subViewType = MemRefType::get({input0Shape[1], input0Shape[2]},
rewriter.getF32Type());
Value subInput0 = rewriter.create<memref::SubViewOp>(loc, subViewType, input0, offsets, sizes, strides);
Pattern : 'linalg.batch_matmul -> ()' {
Trying to match "{anonymous}::BatchMatMulOpLower"
ImplicitTypeIDRegistry::lookupOrInsert(mlir::InferIntRangeInterface::Trait<mlir::TypeID::get() [with Trait = mlir::InferIntRangeInterface::Trait]::Empty>)
** Insert : 'arith.constant'(0x560638451850)
** Insert : 'arith.constant'(0x5606383fb350)
** Insert : 'arith.constant'(0x56063840e040)
** Insert : 'arith.constant'(0x56063840dbd0)
** Insert : 'arith.constant'(0x5606384118f0)
** Insert : 'arith.constant'(0x560638411460)
** Insert : 'arith.constant'(0x5606383fc670)
** Insert : 'arith.constant'(0x5606383fbc70)
** Insert : 'arith.constant'(0x5606383fb7e0)
** Insert : 'arith.constant'(0x5606383cc570)
ImplicitTypeIDRegistry::lookupOrInsert(mlir::OpTrait::HasParent<mlir::scf::ExecuteRegionOp, mlir::scf::ForOp, mlir::scf::IfOp, mlir::scf::IndexSwitchOp, mlir::scf::ParallelOp, mlir::scf::WhileOp>::Impl<mlir::TypeID::get() [with Trait = mlir::OpTrait::HasParent<mlir::scf::ExecuteRegionOp, mlir::scf::ForOp, mlir::scf::IfOp, mlir::scf::IndexSwitchOp, mlir::scf::ParallelOp, mlir::scf::WhileOp>::Impl]::Empty>)
** Insert : 'scf.yield'(0x560638456ab0)
** Insert : 'scf.for'(0x560638456b10)
** Insert : '0yA8V�jE8VyA8V��<8V�������<8VHCD8V
vE8Vh�B8V��>8V�uE8V��>8V::8V�vE8V�uE8V��<8Vp<8V�vE8V�uE8V��<8V��>8V�vE8V�uE8VpQ� vE8V�vE8V�uE8V��<8V@vE8VwE8V�uE8V��<8V`vE8V wE8V�uE8VpQ��vE8V��<8V�uE8V��<8V�vE8V��<8V�uE8V��<8V�vE8VpQ��uE8VpQ���������������������������������������������������������������������������������������PlB8V aE8V��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������lB8V$aE8V lB8VaE8V����������������������������������������������������������������������ђ'(0x5606384575b0)
** Erase : 'linalg.batch_matmul'(0x560638428300)
"{anonymous}::BatchMatMulOpLower" result 1
//===-------------------------------------------===//
Legalizing operation : 'arith.constant'(0x560638451850) {
%6 = "arith.constant"() {value = 2 : index} : () -> index
} -> SUCCESS : operation marked legal by the target
//===-------------------------------------------===//
//===-------------------------------------------===//
Legalizing operation : 'arith.constant'(0x5606383fb350) {
%7 = "arith.constant"() {value = 3 : index} : () -> index
} -> SUCCESS : operation marked legal by the target
//===-------------------------------------------===//
//===-------------------------------------------===//
Legalizing operation : 'arith.constant'(0x56063840e040) {
%8 = "arith.constant"() {value = 3 : index} : () -> index
} -> SUCCESS : operation marked legal by the target
//===-------------------------------------------===//
//===-------------------------------------------===//
Legalizing operation : 'arith.constant'(0x56063840dbd0) {
%9 = "arith.constant"() {value = 3 : index} : () -> index
} -> SUCCESS : operation marked legal by the target
//===-------------------------------------------===//
//===-------------------------------------------===//
Legalizing operation : 'arith.constant'(0x5606384118f0) {
%10 = "arith.constant"() {value = 3 : index} : () -> index
} -> SUCCESS : operation marked legal by the target
//===-------------------------------------------===//
//===-------------------------------------------===//
Legalizing operation : 'arith.constant'(0x560638411460) {
%11 = "arith.constant"() {value = 3 : index} : () -> index
} -> SUCCESS : operation marked legal by the target
//===-------------------------------------------===//
//===-------------------------------------------===//
Legalizing operation : 'arith.constant'(0x5606383fc670) {
%12 = "arith.constant"() {value = 3 : index} : () -> index
} -> SUCCESS : operation marked legal by the target
//===-------------------------------------------===//
//===-------------------------------------------===//
Legalizing operation : 'arith.constant'(0x5606383fbc70) {
%13 = "arith.constant"() {value = 1 : index} : () -> index
} -> SUCCESS : operation marked legal by the target
//===-------------------------------------------===//
//===-------------------------------------------===//
Legalizing operation : 'arith.constant'(0x5606383fb7e0) {
%14 = "arith.constant"() {value = 0 : index} : () -> index
} -> SUCCESS : operation marked legal by the target
//===-------------------------------------------===//
//===-------------------------------------------===//
Legalizing operation : 'arith.constant'(0x5606383cc570) {
%15 = "arith.constant"() {value = 0 : index} : () -> index
} -> SUCCESS : operation marked legal by the target
//===-------------------------------------------===//
//===-------------------------------------------===//
Legalizing operation : 'scf.yield'(0x560638456ab0) {
"scf.yield"() : () -> ()
} -> SUCCESS : operation marked legal by the target
//===-------------------------------------------===//
//===-------------------------------------------===//
Legalizing operation : 'scf.for'(0x560638456b10) {
} -> SUCCESS : operation marked legal by the target
//===-------------------------------------------===//
//===-------------------------------------------===//
Legalizing operation : '0yA8V�jE8VyA8V��<8V�������<8VHCD8V
vE8Vh�B8V��>8V�uE8V��>8V::8V�vE8V�uE8V��<8Vp<8V�vE8V�uE8V��<8V��>8V�vE8V�uE8VpQ� vE8V�vE8V�uE8V��<8V@vE8VwE8V�uE8V��<8V`vE8V wE8V�uE8VpQ��vE8V��<8V�uE8V��<8V�vE8V��<8V�uE8V��<8V�vE8VpQ��uE8VpQ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� aE8V����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������B8V��������������������������������������������������������������������������������������������������������������������������������������������q`28V�;8V��?8V��?8V�<8VР;8V`9@8V��=8V@�98V��;8V@�?8V1(�+�Z3�+�Z3�{E8VHE8V�{E8VHE8V|E8VHE8V|E8VHE8V�{E8V���������������������������������������������������������������@2�Z3ЋE8VЋE8V��������������������������������������������������������s>8V��E8V�����������������������������kB8V��E8V������������������������������������������������������������������������������������������������������������������������������������������������������������;8V�E8V�������������������������������������������������yA8�E8V�������������������������������������������������������������������������������������������������������������������������������+�Z3�E8V0(`28V����������������������uE8V�������`�<8V���������?8V��B8V��������A8V
з?8V��>8VPlB8V������>8V���������������������������������������������������������������@�?8V���������>8V�������P�B8V��������������������������������������������������������������������������������������?8V������������������������������������������@E8V���������@8V �lB8V����`�?8V
��������������p/A8V����М?8VPA8V lB8V�����������`�?8V
��������������h�+�Z3�{E8V����������<8V���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������!A8V�������������������������������������������������������������������������/A8V��������������������������������������������������������������������������������������������������PlB8V�E8V��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������lB8V�E8V lB8V��E8V�����������������������������������p/A8V
�E8V�����������������������������['(0x5606384575b0) {
%16 = "0yA8\06V\00\00\B0jE8\06V\00\00\10yA8\06V\00\00\D0\DC<8\06V\00\00\FF\FF\FF\FF\01\00\00\00\00\00\00\00\00\00\00\80\C8\CE<8\06V\00\00HCD8\06V\00\00\0A\00\00\00\0A\00\00\00\00vE8\06V\00\00h\83B8\06V\00\00\80\9D>8\06V\00\00\B0uE8\06V\00\00\80\9D>8\06V\00\00\10::8\06V\00\00\80vE8\06V\00\00\B0uE8\06V\00\00\D0\DC<8\06V\00\00p\04<8\06V\00\00\A0vE8\06V\00\00\B0uE8\06V\00\00\C8\CE<8\06V\00\00\80\9D>8\06V\00\00\C0vE8\06V\00\00\B0uE8\06V\00\00pQ\CE\1B\FD\7F\00\00 vE8\06V\00\00\E0vE8\06V\00\00\B0uE8\06V\00\00\D0\DC<8\06V\00\00@vE8\06V\00\00\00wE8\06V\00\00\B0uE8\06V\00\00\C8\CE<8\06V\00\00`vE8\06V\00\00 wE8\06V\00\00\B0uE8\06V\00\00pQ\CE\1B\FD\7F\00\00\80vE8\06V\00\00\D0\DC<8\06V\00\00\B0uE8\06V\00\00\D0\DC<8\06V\00\00\A0vE8\06V\00\00\C8\CE<8\06V\00\00\B0uE8\06V\00\00\C8\CE<8\06V\00\00\C0vE8\06V\00\00pQ\CE\1B\FD\7F\00\00\B0uE8\06V\00\00pQ\CE\1B\FD\7F\00\00\00\00\00\00\00\00\00\00\11\04\00\00\00\00\00\00\00\F0\FF\FF\FF\FF\FF\FF\00\00\00\00\00\00\00\00\00\F0\FF\FF\FF\FF\FF\FF\00\00\00\00\00\00\00\00\00\F0\FF\FF\FF\FF\FF\FF\00\F0\FF\FF\FF\FF\FF\FF\00\F0\FF\FF\FF\FF\FF\FF\00\00\00\00\00\00\00\00\00\F0\FF\FF\FF\FF\FF\FF\00\00\00\00\00\00\00\00\00\F0\FF\FF\FF\FF\FF\FF\00\F0\FF\FF\FF\FF\FF\FF\00\F0\FF\FF\FF\FF\FF\FF\00\00\00\00\00\00\00\00\00\F0\FF\FF\FF\FF\FF\FF\00\00\00\00\00\00\00\00\00\F0\FF\FF\FF\FF\FF\FF\00\F0\FF\FF\FF\FF\FF\FF\00\F0\FF\FF\FF\FF\FF\FF\00\00\00\00\00\00\00\00\00\F0\FF\FF\FF\FF\FF\FF\00\00\00\00\00\00\00\00\00\F0\FF\FF\FF\FF\FF\FF\00\F0\FF\FF\FF\FF\FF\FF\00\F0\FF\FF\FF\FF\FF\FF\00\00\00\00\00\00\00\00\00\F0\FF\FF\FF\FF\FF\FF\00\00\00\00\00\00\00\00\00\F0\FF\FF\FF\FF\FF\FF\00\F0\FF\FF\FF\FF\FF\FF\00\F0\FF\FF\FF\FF\FF\FF\00\00\00\00\00\00\00\00\00\F0\FF\FF\FF\FF\FF\FF\00\00\00\00\00\00\00\00\00\F0\FF\FF\FF\FF\FF\FF\00\F0\FF\FF\FF\FF\FF\FF\00\F0\FF\FF\FF\FF\FF\FF\00\00\00\00\00\00\00\00\00\F0\FF\FF\FF\FF\FF\FF aE8\06V\00\00\00\F0\FF\FF\FF\FF\FF\FF\00\F0\FF\FF\FF\FF\FF\FF\00\F0\FF\FF\FF\FF\FF\FF\00\00\00\00\00\00\00\00\00\F0\FF\FF\FF\FF\FF\FF\00\00\00\00\00\00\00\00\00\F0\FF\FF\FF\FF\FF\FF\00\F0\FF\FF\FF\FF\FF\FF\00\F0\FF\FF\FF\FF\FF\FF\00\00\00\00\00\00\00\00\00\F0\FF\FF\FF\FF\FF\FF\00\00\00\00\00\00\00\00\00\F0\FF\FF\FF\FF\FF\FF\00\F0\FF\FF\FF\FF\FF\FF\00\F0\FF\FF\FF\FF\FF\FF\00\00\00\00\00\00\00\00\00\F0\FF\FF\FF\FF\FF\FF\00\00\00\00\00\00\00\00\00\F0\FF\FF\FF\FF\FF\FF\00\F0\FF\FF\FF\FF\FF\FF\00\F0\FF\FF\FF\FF\FF\FF\00\00\00\00\00\00\00\00\00\F0\FF\FF\FF\FF\FF\FF\00\00\00\00\00\00\00\00\00\F0\FF\FF\FF\FF\FF\FF\00\F0\FF\FF\FF\FF\FF\FF\00\F0\FF\FF\FF\FF\FF\FF\00\00\00\00\00\00\00\00\00\F0\FF\FF\FF\FF\FF\FF\00\00\00\00\00\00\00\00\00\F0\FF\FF\FF\FF\FF\FF\00\F0\FF\FF\FF\FF\FF\FF\00\F0\FF\FF\FF\FF\FF\FF\00\00\00\00\00\00\00\00\00\F0\FF\FF\FF\FF\FF\FF\00\00\00\00\00\00\00\00\00\F0\FF\FF\FF\FF\FF\FF\00\F0\FF\FF\FF\FF\FF\FF\00\F0\FF\FF\FF\FF\FF\FF\00\00\00\00\00\00\00\00\00\F0\FF\FF\FF\FF\FF\FF\00\00\00\00\00\00\00\00\00\F0\FF\FF\FF\FF\FF\FF\00\F0\FF\FF\FF\FF\FF\FF\00\F0\FF\FF\FF\FF\FF\FF\00\00\00\00\00\00\00\00\00\F0\FF\FF\FF\FF\FF\FF\00\00\00\00\00\00\00\00\00\F0\FF\FF\FF\FF\FF\FF\00\F0\FF\FF\FF\FF\FF\FF\00\F0\FF\FF\FF\FF\FF\FF\00\00\00\00\00\00\00\00\00\F0\FF\FF\FF\FF\FF\FF\00\00\00\00\00\00\00\00\00\F0\FF\FF\FF\FF\FF\FF\00\F0\FF\FF\FF\FF\FF\FF\00\F0\FF\FF\FF\FF\FF\FF\00\00\00\00\00\00\00\00\00\83B8\06V\00\00\00\00\00\00\00\00\00\00\00\F0\FF\FF\FF\FF\FF\FF\00\F0\FF\FF\FF\FF\FF\FF\00\F0\FF\FF\FF\FF\FF\FF\00\00\00\00\00\00\00\00\00\F0\FF\FF\FF\FF\FF\FF\00\00\00\00\00\00\00\00\00\F0\FF\FF\FF\FF\FF\FF\00\F0\FF\FF\FF\FF\FF\FF\00\F0\FF\FF\FF\FF\FF\FF\00\00\00\00\00\00\00\00\00\F0\FF\FF\FF\FF\FF\FF\00\00\00\00\00\00\00\00\00\F0\FF\FF\FF\FF\FF\FF\00\F0\FF\FF\FF\FF\FF\FF\00\F0\FF\FF\FF\FF\FF\FF\00\00\00\00\00\00\00\00\00\F0\FF\FF\FF\FF\FF\FF\00\00\00\00\00\00\00\00\00\F0\FF\FF\FF\FF\FF\FF\00\F0\FF\FF\FF\FF\FF\FF\00\F0\FF\FF\FF\FF\FF\FF\00\00\00\00\00\00\00\00\00\F0\FF\FF\FF\FF\FF\FF\00\00\00\00\00\00\00\00\00\F0\FF\FF\FF\FF\FF\FF\00\F0\FF\FF\FF\FF\FF\FF\00\F0\FF\FF\FF\FF\FF\FF\00\00\00\00\00\00\00\00\00\F0\FF\FF\FF\FF\FF\FFq\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\10`28\06V\00\00\F0\9E;8\06V\00\00\90\A1?8\06V\00\00\A0\9F?8\06V\00\00\F0\BD<8\06V\00\00\D0\A0;8\06V\00\00`9@8\06V\00\00\E0\D7=8\06V\00\00@\D698\06V\00\00\80\9F;8\06V\00\00@\A0?8\06V\00\00\00\00\00\00\00\00\00\00\11\10\00\00\00\00\00\00\E0+\D7Z3\7F\00\00\E0+\D7Z3\7F\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\D0{E8\06V\00\00\00\00\00\00\00\00\00\00\18HE8\06V\00\00\E8{E8\06V\00\00\00\00\00\00\00\00\00\00\18HE8\06V\00\00\00|E8\06V\00\00\00\00\00\00\00\00\00\00\18HE8\06V\00\00\00|E8\06V\00\00\00\00\00\00\00\00\00\00\18HE8\06V\00\00\E8{E8\06V\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\F0\FF\FF\FF\FF\FF\FF\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\F0\FF\FF\FF\FF\FF\FF\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\F0\FF\FF\FF\FF\FF\FF\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\F0\FF\FF\FF\FF\FF\FF\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\F0\FF\FF\FF\FF\FF\FF\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\F0\FF\FF\FF\FF\FF\FF\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00