[Mlir-commits] [mlir] [MLIR][mesh] Mesh fixes (PR #124724)
Frank Schlimbach
llvmlistbot at llvm.org
Wed Feb 12 01:58:44 PST 2025
================
@@ -608,14 +609,39 @@ class FoldDynamicLists final : public OpRewritePattern<ShardingOp> {
op.getDynamicShardedDimsOffsets(), b);
// No constant operands were folded, just return;
- if (failed(foldDynamicIndexList(mixedHalos, /*onlyNonNegative=*/true)) &&
- failed(foldDynamicIndexList(mixedOffs, /*onlyNonNegative=*/true))) {
- return failure();
- }
+ bool modified = succeeded(foldDynamicIndexList(mixedHalos, true)) ||
+ succeeded(foldDynamicIndexList(mixedOffs, true));
auto halos = decomposeMixedValues(mixedHalos);
auto offs = decomposeMixedValues(mixedOffs);
+ if (halos.second.empty() && !halos.first.empty()) {
+ if (halos.first[0] == 0 && llvm::all_equal(halos.first)) {
+ halos.first.clear();
+ modified = true;
+ }
+ }
+
+ if (offs.second.empty() && !offs.first.empty()) {
----------------
fschlimb wrote:
Done
https://github.com/llvm/llvm-project/pull/124724
More information about the Mlir-commits
mailing list