[Mlir-commits] [mlir] [mlir][memref] Add memref alias folders for expand/collapse_shape for vector load/store (PR #95223)
Kunwar Grover
llvmlistbot at llvm.org
Wed Jun 12 07:10:22 PDT 2024
================
@@ -518,10 +518,25 @@ LogicalResult LoadOpOfExpandShapeOpFolder<OpTy>::matchAndRewrite(
loadOp.getLoc(), rewriter, expandShapeOp, indices, sourceIndices)))
return failure();
llvm::TypeSwitch<Operation *, void>(loadOp)
- .Case<affine::AffineLoadOp, memref::LoadOp>([&](auto op) {
- rewriter.replaceOpWithNewOp<decltype(op)>(
+ .Case([&](affine::AffineLoadOp op) {
+ rewriter.replaceOpWithNewOp<affine::AffineLoadOp>(
loadOp, expandShapeOp.getViewSource(), sourceIndices);
})
+ .Case([&](memref::LoadOp op) {
+ rewriter.replaceOpWithNewOp<memref::LoadOp>(
+ loadOp, expandShapeOp.getViewSource(), sourceIndices,
+ op.getNontemporal());
+ })
----------------
Groverkss wrote:
updated all tests touching these patterns + memref.load/store vector.load/store to have a nontemporal attribute and check if they are preserved.
https://github.com/llvm/llvm-project/pull/95223
More information about the Mlir-commits
mailing list