diff options
| author | Matthias Springer <me@m-sp.org> | 2023-06-22 10:39:34 +0200 |
|---|---|---|
| committer | Matthias Springer <me@m-sp.org> | 2023-06-22 10:47:38 +0200 |
| commit | efc290ce9c2b85bbd66ebc9ea43986fe89cbff15 (patch) | |
| tree | c9d9dbc89b2aad7a8c8d3788f451550c14173dbc /mlir/lib/Dialect/Vector/Transforms/VectorTransferSplitRewritePatterns.cpp | |
| parent | 8762bc77b42f942d13f1bc1637b834262e0d00f4 (diff) | |
[mlir][affine] More efficient `makeComposedFolded...` helpers
The old code used to materialize constants as ops, immediately folded them into the resulting affine map and then deleted the constant ops again. Instead, directly fold the attributes into the affine map. Furthermore, all helpers accept `OpFoldResult` instead of `Value` now. This makes the code at call sites more efficient, because it is no longer necessary to materialize a `Value`, just to be able to use these helper functions.
Note: The API has changed (accepts OpFoldResult instead of Value), otherwise this change is NFC.
Differential Revision: https://reviews.llvm.org/D153324
Diffstat (limited to 'mlir/lib/Dialect/Vector/Transforms/VectorTransferSplitRewritePatterns.cpp')
| -rw-r--r-- | mlir/lib/Dialect/Vector/Transforms/VectorTransferSplitRewritePatterns.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/mlir/lib/Dialect/Vector/Transforms/VectorTransferSplitRewritePatterns.cpp b/mlir/lib/Dialect/Vector/Transforms/VectorTransferSplitRewritePatterns.cpp index 6dacb1e199f3..3aa5cd01928d 100644 --- a/mlir/lib/Dialect/Vector/Transforms/VectorTransferSplitRewritePatterns.cpp +++ b/mlir/lib/Dialect/Vector/Transforms/VectorTransferSplitRewritePatterns.cpp @@ -77,7 +77,7 @@ static Value createInBoundsCond(RewriterBase &b, auto d0 = getAffineDimExpr(0, xferOp.getContext()); auto vs = getAffineConstantExpr(vectorSize, xferOp.getContext()); Value sum = affine::makeComposedAffineApply(b, loc, d0 + vs, - xferOp.indices()[indicesIdx]); + {xferOp.indices()[indicesIdx]}); Value cond = createFoldedSLE( b, sum, vector::createOrFoldDimOp(b, loc, xferOp.source(), indicesIdx)); if (!cond) |
