[Mlir-commits] [mlir] d243378 - [mlir][vector] Use dyn_cast in if conditions

Lei Zhang llvmlistbot at llvm.org
Tue Aug 22 08:27:47 PDT 2023


Author: Lei Zhang
Date: 2023-08-22T08:27:40-07:00
New Revision: d2433787227046f65aeb1ad04bab7038511fe76f

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

LOG: [mlir][vector] Use dyn_cast in if conditions

Reviewed By: dcaballe

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

Added: 
    

Modified: 
    mlir/lib/Dialect/Vector/Transforms/VectorDistribute.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Dialect/Vector/Transforms/VectorDistribute.cpp b/mlir/lib/Dialect/Vector/Transforms/VectorDistribute.cpp
index 61c2b2d580d03a..05b5ff09321489 100644
--- a/mlir/lib/Dialect/Vector/Transforms/VectorDistribute.cpp
+++ b/mlir/lib/Dialect/Vector/Transforms/VectorDistribute.cpp
@@ -1466,7 +1466,7 @@ struct WarpOpScfForOp : public OpRewritePattern<WarpExecuteOnLane0Op> {
             if (!escapingValues.insert(operand->get()))
               return;
             Type distType = operand->get().getType();
-            if (auto vecType = cast<VectorType>(distType)) {
+            if (auto vecType = dyn_cast<VectorType>(distType)) {
               AffineMap map = distributionMapFn(operand->get());
               distType = getDistributedType(vecType, map, warpOp.getWarpSize());
             }


        


More information about the Mlir-commits mailing list