[Mlir-commits] [mlir] [MLIR] Fix: `cast` were meant to be `dyn_cast`. (PR #110518)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Mon Sep 30 08:05:03 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-mlir-affine

@llvm/pr-subscribers-mlir

Author: Benoit Jacob (bjacob)

<details>
<summary>Changes</summary>

This fixes `cast`'s that were introduced in https://github.com/llvm/llvm-project/pull/108450.

---
Full diff: https://github.com/llvm/llvm-project/pull/110518.diff


1 Files Affected:

- (modified) mlir/lib/Dialect/Affine/IR/AffineOps.cpp (+2-2) 


``````````diff
diff --git a/mlir/lib/Dialect/Affine/IR/AffineOps.cpp b/mlir/lib/Dialect/Affine/IR/AffineOps.cpp
index 1ccff7324f514d..5e7a6b6ca883c3 100644
--- a/mlir/lib/Dialect/Affine/IR/AffineOps.cpp
+++ b/mlir/lib/Dialect/Affine/IR/AffineOps.cpp
@@ -4612,12 +4612,12 @@ struct DropDelinearizeOfSingleLoop
       return failure();
 
     // Check that the `linear_index` is an induction variable.
-    auto inductionVar = cast<BlockArgument>(delinearizeOp.getLinearIndex());
+    auto inductionVar = dyn_cast<BlockArgument>(delinearizeOp.getLinearIndex());
     if (!inductionVar)
       return failure();
 
     // Check that the parent is a `LoopLikeOpInterface`.
-    auto loopLikeOp = cast<LoopLikeOpInterface>(
+    auto loopLikeOp = dyn_cast<LoopLikeOpInterface>(
         inductionVar.getParentRegion()->getParentOp());
     if (!loopLikeOp)
       return failure();

``````````

</details>


https://github.com/llvm/llvm-project/pull/110518


More information about the Mlir-commits mailing list