[Mlir-commits] [mlir] [MLIR][Mesh] Add sharding propagation pass (PR #69665)
Mehdi Amini
llvmlistbot at llvm.org
Thu Oct 19 22:25:19 PDT 2023
================
@@ -24,4 +24,26 @@
#define GET_OP_CLASSES
#include "mlir/Dialect/Mesh/IR/MeshOps.h.inc"
+namespace mlir {
+namespace mesh {
+
+bool isReductionLoop(IteratorType iType);
+
+bool areReductionAndPartialMatch(IteratorType iType, Partial partial);
+
+template <typename T>
+void removeTrailingEmptySubArray(SmallVector<SmallVector<T>> &array) {
+ for (int64_t i = array.size() - 1; i >= 0; i--) {
+ if (array[i].empty())
+ array.pop_back();
+ else
+ break;
+ }
----------------
joker-eph wrote:
```suggestion
while(!array.empty() && array.back().empty()) array.pop_back();
```
https://github.com/llvm/llvm-project/pull/69665
More information about the Mlir-commits
mailing list