[Mlir-commits] [mlir] [mlir] Replace dynamic sizes in insert_slice of tensor.cast canonicalization (PR #91352)
Han-Chung Wang
llvmlistbot at llvm.org
Tue May 7 13:57:08 PDT 2024
================
@@ -2711,15 +2711,38 @@ struct InsertSliceOpCastFolder final : public OpRewritePattern<InsertOpTy> {
auto dstType = llvm::dyn_cast<RankedTensorType>(dst.getType());
if (!srcType || !dstType)
return failure();
+
+ // The tensor.cast source could have additional static information not seen
+ // in the insert slice op static sizes, so we ignore dynamic dims when
+ // computing the rank reduction mask.
+ SmallVector<int64_t> staticSizes(insertSliceOp.getStaticSizes());
----------------
hanhanW wrote:
I see, somehow I missed it when I was searching the use of the variable.
https://github.com/llvm/llvm-project/pull/91352
More information about the Mlir-commits
mailing list