-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[MLIR] Fix: cast
were meant to be dyn_cast
.
#110518
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: Benoit Jacob <[email protected]>
cast
were meant to be dyn_cast
.cast
were meant to be dyn_cast
.
@llvm/pr-subscribers-mlir-affine @llvm/pr-subscribers-mlir Author: Benoit Jacob (bjacob) ChangesThis fixes Full diff: https://github.com/llvm/llvm-project/pull/110518.diff 1 Files Affected:
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();
|
Cherry-picks: 1. Cherry-picking llvm/llvm-project#110518 Carrying two local reverts: 1. Revert llvm/llvm-project#100667) - As noted by @hanhanW on #18619, that PR "breaks the stablehlo build. We need to wait stablehlo bumping LLVM ahead of it and fix the issue. Then we can bump stablehlo and drop the local commit together." 2. Revert llvm/llvm-project#110170) - That is just the Bazel change accompanying 1. Signed-off-by: Benoit Jacob <[email protected]>
Can we have a test that fails these? |
Correct, this was caught by IREE tests, so we are missing that coverage upstream. I'll send something. |
llvm/llvm-project#110518 fixed assertion failures in `cast` introduced in llvm/llvm-project#108450. Signed-off-by: Benoit Jacob <[email protected]>
llvm#110518 fixed assertion failures in `cast` introduced in llvm#108450. Signed-off-by: Benoit Jacob <[email protected]>
This fixes
cast
's that were introduced in #108450.