diff --git a/mlir/include/mlir/Dialect/Shape/IR/ShapeOps.td b/mlir/include/mlir/Dialect/Shape/IR/ShapeOps.td --- a/mlir/include/mlir/Dialect/Shape/IR/ShapeOps.td +++ b/mlir/include/mlir/Dialect/Shape/IR/ShapeOps.td @@ -345,7 +345,7 @@ //TODO(tpopp): Move the code below and witnesses to a different file. def Shape_AnyOp : Shape_Op<"any", - [DeclareOpInterfaceMethods]> { + [NoSideEffect, DeclareOpInterfaceMethods]> { let summary = "Return any combination of the input shapes."; let description = [{ This operation takes multiple input shapes and returns some combination of @@ -367,7 +367,7 @@ let assemblyFormat = "`(` $inputs `)` attr-dict"; } -def Shape_AssumingAllOp : Shape_Op<"assuming_all", []> { +def Shape_AssumingAllOp : Shape_Op<"assuming_all", [NoSideEffect]> { let summary = "Return a logical AND of all witnesses."; let description = [{ Used to simplify constraints as any single failing precondition is enough @@ -425,7 +425,7 @@ let assemblyFormat = "attr-dict ($operands^ `:` type($operands))?"; } -def Shape_CstrBroadcastableOp : Shape_Op<"cstr_broadcastable", []> { +def Shape_CstrBroadcastableOp : Shape_Op<"cstr_broadcastable", [NoSideEffect]> { let summary = "Determines if 2 shapes can be successfully broadcasted."; let description = [{ Given 2 input shapes, return a witness specifying if they are broadcastable. @@ -446,7 +446,7 @@ let assemblyFormat = "`(` $lhs `,` $rhs `)` attr-dict"; } -def Shape_CstrEqOp : Shape_Op<"cstr_eq", []> { +def Shape_CstrEqOp : Shape_Op<"cstr_eq", [NoSideEffect]> { let summary = "Determines if all input shapes are equal."; let description = [{ Given 1 or more input shapes, determine if all shapes are the exact same.