replace deprecated "rewriter.create()" pattern

refactor PIM to Pim everywhere except for the accelerator name
This commit is contained in:
NiccoloN
2026-03-20 13:30:53 +01:00
parent 916a09414c
commit bb6dcd38a3
32 changed files with 222 additions and 212 deletions

View File

@@ -29,7 +29,7 @@ def matMulToGemmPattern : Pat<
(ONNXMatMulOp:$matmulres $A, $B),
(
ONNXGemmOp $A, $B,
/* C = */ (NativeCodeCall<"$_builder.create<tensor::EmptyOp>($_loc, cast<ShapedType>(matmulres.getY().getType()).getShape(), cast<ShapedType>(matmulres.getY().getType()).getElementType());">),
/* C = */ (NativeCodeCall<"tensor::EmptyOp::create($_builder, $_loc, cast<ShapedType>(matmulres.getY().getType()).getShape(), cast<ShapedType>(matmulres.getY().getType()).getElementType());">),
/* alpha = */ (NativeCodeCall<"$_builder.getF32FloatAttr(1)">),
/* beta = */ (NativeCodeCall<"$_builder.getF32FloatAttr(0)">),
/* transA = */ (NativeCodeCall<"IntegerAttr::get($_builder.getIntegerType(64, true), 0)">),
@@ -70,4 +70,4 @@ def removeFlattenSameShapePattern : Pat<
[(HaveSameStaticShape $flattenOp, $A)]
>; // Add closing parenthesis here
#endif // ONNX_TO_SPATIAL
#endif // ONNX_TO_SPATIAL