Should be chained after https://reviews.llvm.org/D140186
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
mlir/lib/Dialect/Linalg/TransformOps/LinalgTransformOps.cpp | ||
---|---|---|
71–77 | Can we try to make it simpler? They all share same logic to me, and we don't want dup a lot of code. E.g., can we try MACRO way or are there other better ways? I know that we use MACRO to simplify logic in ArithToSPIRV conversion: https://github.com/llvm/llvm-project/blob/27249c06b775c73b7fa9f2d8e48cac1a85169481/mlir/lib/Conversion/ArithToSPIRV/ArithToSPIRV.cpp#L845-L867 |
mlir/lib/Dialect/Linalg/Transforms/Transforms.cpp | ||
---|---|---|
615–646 | maybe we can simplify this using std::tuple. E.g., std::tie(khIndex, kwIndex, ohIndex, owIndex) = TypeSwitch<Operation *, std::tuple<int64_t, int64_t, int64_t, int64_t>(convOp) ... .Case([&](linalg::PoolingNchwSumOp op) { return std::make_tuple(0, 1, 2, 3); }) and maybe plus using structured binding: auto [khIndex, kwIndex, ohIndex, owIndex] = TypeSwitch<Operation *, std::tuple<int64_t, int64_t, int64_t, int64_t>(convOp) ... |
Comment Actions
overall looks good to me
mlir/lib/Dialect/Linalg/TransformOps/LinalgTransformOps.cpp | ||
---|---|---|
71–77 | can you use one macro, not three? |
Can we try to make it simpler? They all share same logic to me, and we don't want dup a lot of code. E.g., can we try MACRO way or are there other better ways?
I know that we use MACRO to simplify logic in ArithToSPIRV conversion: https://github.com/llvm/llvm-project/blob/27249c06b775c73b7fa9f2d8e48cac1a85169481/mlir/lib/Conversion/ArithToSPIRV/ArithToSPIRV.cpp#L845-L867