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();
}
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();
}
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();
}
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();
}
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();
}
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();
}