Update traits (NoSideEffect)

This commit is contained in:
Yan Da
2022-04-27 19:41:07 +08:00
parent 8dfe78f6cf
commit edca91bf8f
6 changed files with 17 additions and 272 deletions

View File

@@ -9,8 +9,8 @@
#include "mlir/Dialect/SCF/SCF.h"
#include "triton/Dialect/Triton/IR/Traits.h"
#include "triton/Dialect/Triton/Dialect.h.inc"
#include "triton/Dialect/Triton/OpsEnums.h.inc"
#include "triton/Dialect/Triton/IR/Dialect.h.inc"
#include "triton/Dialect/Triton/IR/OpsEnums.h.inc"
#define GET_OP_CLASSES
#include "triton/Dialect/Triton/IR/Ops.h.inc"

View File

@@ -198,7 +198,7 @@ def TT_GEPOp : TT_Op<"getelementptr",
//
// Shape Manipulation Ops
//
def TT_ReshapeOp : TT_Op<"reshape", [SameOperandsAndResultElementType]> {
def TT_ReshapeOp : TT_Op<"reshape", [NoSideEffect, SameOperandsAndResultElementType]> {
let summary = "reshape";
let arguments = (ins TT_Tensor:$src);
@@ -208,7 +208,7 @@ def TT_ReshapeOp : TT_Op<"reshape", [SameOperandsAndResultElementType]> {
let assemblyFormat = "$src attr-dict `:` functional-type(operands, results)";
}
def TT_BroadcastOp : TT_Op<"broadcast", [SameOperandsAndResultElementType]> {
def TT_BroadcastOp : TT_Op<"broadcast", [NoSideEffect, SameOperandsAndResultElementType]> {
let summary = "broadcast";
let arguments = (ins TT_Type:$src);
@@ -220,7 +220,7 @@ def TT_BroadcastOp : TT_Op<"broadcast", [SameOperandsAndResultElementType]> {
let hasFolder = 1;
}
def TT_CatOp : TT_Op<"cat", [SameOperandsAndResultElementType]> {
def TT_CatOp : TT_Op<"cat", [NoSideEffect, SameOperandsAndResultElementType]> {
let summary = "concatenate 2 tensors";
let arguments = (ins TT_Tensor:$lhs, TT_Tensor:$rhs);

View File

@@ -1,12 +0,0 @@
#ifndef TRITON_TRANSFORMS_PASSES_H_
#define TRITON_TRANSFORMS_PASSES_H_
#include "mlir/Pass/Pass.h"
std::unique_ptr<Pass> createCombineOpsPass();
// // Registration
// #define GEN_PASS_REGISTRATION
// #include
#endif // TRITON_TRANSFORMS_PASSES_H_