[Mlir-commits] [mlir] [mlir][mesh] add support in spmdization for incomplete sharding annotations (PR #82442)
Lei Zhang
llvmlistbot at llvm.org
Tue Feb 20 21:41:06 PST 2024
================
@@ -615,34 +614,59 @@ static SmallVector<MeshShardingAttr> getResultShardings(Operation &op) {
assert(result.hasOneUse());
Operation *userOp = *result.getUsers().begin();
ShardOp shardOp = llvm::cast<ShardOp>(userOp);
- assert(!shardOp.getAnnotateForUsers());
return shardOp.getShard();
});
return res;
}
+static ShardOp getSourceShardOpOrNull(ShardOp targetShardOp) {
+ Operation *srcOp = targetShardOp.getOperand().getDefiningOp();
+ if (!srcOp) {
----------------
antiagainst wrote:
By LLVM convention we don't nee `{ ... }` for simple loops like this.
https://github.com/llvm/llvm-project/pull/82442
More information about the Mlir-commits
mailing list