[Mlir-commits] [mlir] [mlir][vector] Add n-d deinterleave lowering (PR #94237)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Mon Jun 3 09:02:42 PDT 2024
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff fecf5c74920705bf9d15ce0db4b04fdcfa05f104 234fe8c54b690178b6feea632b509312db783d41 -- mlir/lib/Dialect/Vector/Transforms/LowerVectorInterleave.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/mlir/lib/Dialect/Vector/Transforms/LowerVectorInterleave.cpp b/mlir/lib/Dialect/Vector/Transforms/LowerVectorInterleave.cpp
index 557837426d..138128516f 100644
--- a/mlir/lib/Dialect/Vector/Transforms/LowerVectorInterleave.cpp
+++ b/mlir/lib/Dialect/Vector/Transforms/LowerVectorInterleave.cpp
@@ -79,7 +79,8 @@ private:
int64_t targetRank = 1;
};
-class UnrollDeinterleaveOp final : public OpRewritePattern<vector::DeinterleaveOp> {
+class UnrollDeinterleaveOp final
+ : public OpRewritePattern<vector::DeinterleaveOp> {
public:
UnrollDeinterleaveOp(int64_t targetRank, MLIRContext *context,
PatternBenefit benefit = 1)
@@ -99,14 +100,14 @@ public:
loc, resultType, rewriter.getZeroAttr(resultType));
for (auto position : *unrollIterator) {
- auto extractSrc = rewriter.create<vector::ExtractOp>(
- loc, op.getSource(), position);
- auto deinterleave = rewriter.create<vector::DeinterleaveOp>(
- loc, extractSrc);
+ auto extractSrc =
+ rewriter.create<vector::ExtractOp>(loc, op.getSource(), position);
+ auto deinterleave =
+ rewriter.create<vector::DeinterleaveOp>(loc, extractSrc);
evenResult = rewriter.create<vector::InsertOp>(
- loc, deinterleave.getRes1(), evenResult, position);
- oddResult = rewriter.create<vector::InsertOp>(
- loc, deinterleave.getRes2(), oddResult, position);
+ loc, deinterleave.getRes1(), evenResult, position);
+ oddResult = rewriter.create<vector::InsertOp>(loc, deinterleave.getRes2(),
+ oddResult, position);
}
rewriter.replaceOp(op, ValueRange{evenResult, oddResult});
return success();
@@ -153,7 +154,8 @@ struct InterleaveToShuffle final : OpRewritePattern<vector::InterleaveOp> {
void mlir::vector::populateVectorInterleaveLoweringPatterns(
RewritePatternSet &patterns, int64_t targetRank, PatternBenefit benefit) {
patterns.add<UnrollInterleaveOp>(targetRank, patterns.getContext(), benefit);
- patterns.add<UnrollDeinterleaveOp>(targetRank, patterns.getContext(), benefit);
+ patterns.add<UnrollDeinterleaveOp>(targetRank, patterns.getContext(),
+ benefit);
}
void mlir::vector::populateVectorInterleaveToShufflePatterns(
``````````
</details>
https://github.com/llvm/llvm-project/pull/94237
More information about the Mlir-commits
mailing list