[mlir][Tutorial] Fix comment position in SimplifyRedundantTranspose.
authorMatthias Kramm <kramm@google.com>
Fri, 28 Feb 2020 01:54:22 +0000 (17:54 -0800)
committerRiver Riddle <riddleriver@gmail.com>
Fri, 28 Feb 2020 01:55:07 +0000 (17:55 -0800)
Summary:
This is a cosmetic change to make the "bingo" comment be in the
right place.

Differential Revision: https://reviews.llvm.org/D75264

mlir/docs/Tutorials/Toy/Ch-3.md
mlir/examples/toy/Ch3/mlir/ToyCombine.cpp
mlir/examples/toy/Ch4/mlir/ToyCombine.cpp
mlir/examples/toy/Ch5/mlir/ToyCombine.cpp
mlir/examples/toy/Ch6/mlir/ToyCombine.cpp
mlir/examples/toy/Ch7/mlir/ToyCombine.cpp

index c328182..9d59117 100644 (file)
@@ -93,11 +93,12 @@ struct SimplifyRedundantTranspose : public mlir::OpRewritePattern<TransposeOp> {
     mlir::Value transposeInput = op.getOperand();
     TransposeOp transposeInputOp =
         llvm::dyn_cast_or_null<TransposeOp>(transposeInput.getDefiningOp());
-    // If the input is defined by another Transpose, bingo!
+
+    // Input defined by another transpose? If not, no match.
     if (!transposeInputOp)
       return matchFailure();
 
-    // Use the rewriter to perform the replacement
+    // Otherwise, we have a redundant transpose. Use the rewriter.
     rewriter.replaceOp(op, {transposeInputOp.getOperand()}, {transposeInputOp});
     return matchSuccess();
   }
index e42a20c..da1c363 100644 (file)
@@ -43,11 +43,11 @@ struct SimplifyRedundantTranspose : public mlir::OpRewritePattern<TransposeOp> {
     TransposeOp transposeInputOp =
         llvm::dyn_cast_or_null<TransposeOp>(transposeInput.getDefiningOp());
 
-    // If the input is defined by another Transpose, bingo!
+    // Input defined by another transpose? If not, no match.
     if (!transposeInputOp)
       return matchFailure();
 
-    // Use the rewriter to perform the replacement.
+    // Otherwise, we have a redundant transpose. Use the rewriter.
     rewriter.replaceOp(op, {transposeInputOp.getOperand()});
     return matchSuccess();
   }
index 5b15397..82a1ee0 100644 (file)
@@ -48,11 +48,11 @@ struct SimplifyRedundantTranspose : public mlir::OpRewritePattern<TransposeOp> {
     TransposeOp transposeInputOp =
         llvm::dyn_cast_or_null<TransposeOp>(transposeInput.getDefiningOp());
 
-    // If the input is defined by another Transpose, bingo!
+    // Input defined by another transpose? If not, no match.
     if (!transposeInputOp)
       return matchFailure();
 
-    // Use the rewriter to perform the replacement.
+    // Otherwise, we have a redundant transpose. Use the rewriter.
     rewriter.replaceOp(op, {transposeInputOp.getOperand()});
     return matchSuccess();
   }
index 5b15397..82a1ee0 100644 (file)
@@ -48,11 +48,11 @@ struct SimplifyRedundantTranspose : public mlir::OpRewritePattern<TransposeOp> {
     TransposeOp transposeInputOp =
         llvm::dyn_cast_or_null<TransposeOp>(transposeInput.getDefiningOp());
 
-    // If the input is defined by another Transpose, bingo!
+    // Input defined by another transpose? If not, no match.
     if (!transposeInputOp)
       return matchFailure();
 
-    // Use the rewriter to perform the replacement.
+    // Otherwise, we have a redundant transpose. Use the rewriter.
     rewriter.replaceOp(op, {transposeInputOp.getOperand()});
     return matchSuccess();
   }
index 5b15397..82a1ee0 100644 (file)
@@ -48,11 +48,11 @@ struct SimplifyRedundantTranspose : public mlir::OpRewritePattern<TransposeOp> {
     TransposeOp transposeInputOp =
         llvm::dyn_cast_or_null<TransposeOp>(transposeInput.getDefiningOp());
 
-    // If the input is defined by another Transpose, bingo!
+    // Input defined by another transpose? If not, no match.
     if (!transposeInputOp)
       return matchFailure();
 
-    // Use the rewriter to perform the replacement.
+    // Otherwise, we have a redundant transpose. Use the rewriter.
     rewriter.replaceOp(op, {transposeInputOp.getOperand()});
     return matchSuccess();
   }
index 2817778..9f0795f 100644 (file)
@@ -66,11 +66,11 @@ struct SimplifyRedundantTranspose : public mlir::OpRewritePattern<TransposeOp> {
     TransposeOp transposeInputOp =
         llvm::dyn_cast_or_null<TransposeOp>(transposeInput.getDefiningOp());
 
-    // If the input is defined by another Transpose, bingo!
+    // Input defined by another transpose? If not, no match.
     if (!transposeInputOp)
       return matchFailure();
 
-    // Use the rewriter to perform the replacement.
+    // Otherwise, we have a redundant transpose. Use the rewriter.
     rewriter.replaceOp(op, {transposeInputOp.getOperand()});
     return matchSuccess();
   }