[Mlir-commits] [mlir] [mlir][arith] Add memref alias folders for expand/collapse_shape for vector load/store (PR #95223)
Markus Böck
llvmlistbot at llvm.org
Wed Jun 12 06:03:05 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());
+ })
----------------
zero9178 wrote:
This seems to also fix that non-temporal are now properly preserved. Should there also be a test for this?
https://github.com/llvm/llvm-project/pull/95223
More information about the Mlir-commits
mailing list