[Mlir-commits] [mlir] ea68588 - [mlir][linalg] fix switch case for conv-vec to have brackets
Hanhan Wang
llvmlistbot at llvm.org
Wed Sep 14 13:09:00 PDT 2022
Author: Stanley Winata
Date: 2022-09-14T13:08:28-07:00
New Revision: ea68588ee612c47f5ef395c0d8600d785820e352
URL: https://github.com/llvm/llvm-project/commit/ea68588ee612c47f5ef395c0d8600d785820e352
DIFF: https://github.com/llvm/llvm-project/commit/ea68588ee612c47f5ef395c0d8600d785820e352.diff
LOG: [mlir][linalg] fix switch case for conv-vec to have brackets
Windows build requires brackets on switch-cases that initializes
variables.
Reviewed By: hanchung
Differential Revision: https://reviews.llvm.org/D133889
Added:
Modified:
mlir/lib/Dialect/Linalg/Transforms/Vectorization.cpp
Removed:
################################################################################
diff --git a/mlir/lib/Dialect/Linalg/Transforms/Vectorization.cpp b/mlir/lib/Dialect/Linalg/Transforms/Vectorization.cpp
index 271d96219a0c..ccedde077434 100644
--- a/mlir/lib/Dialect/Linalg/Transforms/Vectorization.cpp
+++ b/mlir/lib/Dialect/Linalg/Transforms/Vectorization.cpp
@@ -1469,7 +1469,7 @@ struct Conv1DGenerator : public StructuredGenerator<LinalgOp> {
case Conv1DOpOrder::Nwc:
// Base case, so no transposes necessary.
break;
- case Conv1DOpOrder::Ncw:
+ case Conv1DOpOrder::Ncw: {
// To match base vectorization case, we pre-transpose current case.
// ncw -> nwc
static constexpr std::array<int64_t, 3> permLhs = {0, 2, 1};
@@ -1481,6 +1481,7 @@ struct Conv1DGenerator : public StructuredGenerator<LinalgOp> {
static constexpr std::array<int64_t, 3> permRes = {0, 2, 1};
res = builder.create<vector::TransposeOp>(loc, res, permRes);
break;
+ }
default:
return failure();
}
@@ -1545,11 +1546,12 @@ struct Conv1DGenerator : public StructuredGenerator<LinalgOp> {
case Conv1DOpOrder::Nwc:
// Base case, so no transposes necessary.
break;
- case Conv1DOpOrder::Ncw:
+ case Conv1DOpOrder::Ncw: {
// nwf -> nfw
static constexpr std::array<int64_t, 3> perm = {0, 2, 1};
res = builder.create<vector::TransposeOp>(loc, res, perm);
break;
+ }
default:
return failure();
}
More information about the Mlir-commits
mailing list