[PATCH] D80179: [mlir] Mark witness related Shape dialect ops as NoSideEffect.

Theodore Popp via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 18 21:40:51 PDT 2020


tpopp created this revision.
tpopp added a reviewer: herhut.
Herald added subscribers: llvm-commits, jurahul, Kayjukh, frgossen, grosul1, Joonsoo, stephenneuendorffer, liufengdb, lucyrfox, mgester, arpith-jacob, nicolasvasilache, antiagainst, shauheen, jpienaar, rriddle, mehdi_amini.
Herald added a reviewer: jpienaar.
Herald added a reviewer: silvas.
Herald added a project: LLVM.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D80179

Files:
  mlir/include/mlir/Dialect/Shape/IR/ShapeOps.td


Index: mlir/include/mlir/Dialect/Shape/IR/ShapeOps.td
===================================================================
--- mlir/include/mlir/Dialect/Shape/IR/ShapeOps.td
+++ 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<InferTypeOpInterface>]> {
+    [NoSideEffect, DeclareOpInterfaceMethods<InferTypeOpInterface>]> {
   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.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D80179.264786.patch
Type: text/x-patch
Size: 1805 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200519/88ddd7ad/attachment-0001.bin>


More information about the llvm-commits mailing list