feat: toy tutorial chapter 3.

Signed-off-by: jackfiled <xcrenchangjun@outlook.com>
This commit is contained in:
2025-06-02 17:22:53 +08:00
parent 8d2f844e2b
commit eacf20fe3c
7 changed files with 157 additions and 31 deletions

View File

@@ -246,6 +246,8 @@ def ReshapeOp : Hello_Op<"reshape"> {
let assemblyFormat = [{
`(` $input `:` type($input) `)` attr-dict `to` type(results)
}];
let hasCanonicalizer = 1;
}
//===----------------------------------------------------------------------===//
@@ -294,7 +296,7 @@ def ReturnOp : Hello_Op<"return", [Pure, HasParent<"FuncOp">,
// TransposeOp
//===----------------------------------------------------------------------===//
def TransposeOp : Hello_Op<"transpose"> {
def TransposeOp : Hello_Op<"transpose", [Pure]> {
let summary = "transpose operation";
let arguments = (ins F64Tensor:$input);
@@ -311,6 +313,7 @@ def TransposeOp : Hello_Op<"transpose"> {
// Invoke a static verify method to verify this transpose operation.
let hasVerifier = 1;
let hasCanonicalizer = 1;
}
#endif