Skip to content
Commit 2ada5cbe authored by Vladislav Vinogradov's avatar Vladislav Vinogradov
Browse files

[mlir][linalg] Fix bug in InferStaticShapeOfOperands pattern

The pattern tries to deduce static shape from `tensor.cast` producer of linalg operation operands.
The original code unconditionally casts type of the `tensor.cast` source to `RankedTensorType`.
But the `tensor.cast` can also operate on `UnrankedTensorType`, so this cast either fail on assertion
in debug build or introduce UB in release build.

The patch replaces unconditional cast with `dyn_cast` and check for the cast result.

Reviewed By: mravishankar

Differential Revision: https://reviews.llvm.org/D137775
parent 981dac8b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment