[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 09:44:15 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:
The values won't be modified, how about using `ArrayRef<int64_t>` here?
https://github.com/llvm/llvm-project/pull/91352
More information about the Mlir-commits
mailing list