[Mlir-commits] [mlir] 902777d - [mlir][Linalg] Fix missing template keyword.

llvmlistbot at llvm.org llvmlistbot at llvm.org
Wed May 13 10:08:57 PDT 2020


Author: MaheshRavishankar
Date: 2020-05-13T10:08:26-07:00
New Revision: 902777ded5c0e049d21f9c2bea195b57dcf3d34f

URL: https://github.com/llvm/llvm-project/commit/902777ded5c0e049d21f9c2bea195b57dcf3d34f
DIFF: https://github.com/llvm/llvm-project/commit/902777ded5c0e049d21f9c2bea195b57dcf3d34f.diff

LOG: [mlir][Linalg] Fix missing template keyword.

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

Added: 
    

Modified: 
    mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp b/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp
index 47697f472d94..074d3a5f8b52 100644
--- a/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp
+++ b/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp
@@ -296,8 +296,7 @@ struct CollapseReshapeOps : public OpRewritePattern<ReshapeOpTy> {
   using OpRewritePattern<ReshapeOpTy>::OpRewritePattern;
   LogicalResult matchAndRewrite(ReshapeOpTy reshapeOp,
                                 PatternRewriter &rewriter) const override {
-    auto srcReshapeOp =
-        dyn_cast_or_null<ReshapeOpTy>(reshapeOp.src().getDefiningOp());
+    auto srcReshapeOp = reshapeOp.src().template getDefiningOp<ReshapeOpTy>();
     if (!srcReshapeOp)
       return failure();
 
@@ -340,7 +339,7 @@ static OpFoldResult foldReshapeOp(ReshapeOpTy reshapeOp) {
   // producer is same as the return type of the consumer. This can only be
   // verified if the shapes in question are static.
   ReshapeOpTy reshapeSrcOp =
-      dyn_cast_or_null<ReshapeOpTy>(reshapeOp.src().getDefiningOp());
+      reshapeOp.src().template getDefiningOp<ReshapeOpTy>();
   if (reshapeSrcOp && reshapeSrcOp.getSrcType().hasStaticShape() &&
       reshapeOp.getResultType().hasStaticShape() &&
       reshapeSrcOp.getSrcType() == reshapeOp.getResultType())


        


More information about the Mlir-commits mailing list