[Mlir-commits] [mlir] [MLIR][mesh] Mesh fixes (PR #124724)

Renato Golin llvmlistbot at llvm.org
Mon Feb 10 10:08:47 PST 2025


================
@@ -316,9 +316,13 @@ void mlir::mesh::maybeInsertSourceShardingAnnotation(MeshSharding sharding,
                                                      OpBuilder &builder) {
   OpBuilder::InsertionGuard insertionGuard(builder);
   Value operandValue = operand.get();
-  Operation *operandOp = operand.getOwner();
   Operation *operandSrcOp = operandValue.getDefiningOp();
   bool isBlockArg = !operandSrcOp;
+  if(!isBlockArg && operandSrcOp->hasTrait<OpTrait::ConstantLike>()) {
----------------
rengolin wrote:

nit: took me a second to parse. I'd use ` if(operandSrcOp && operandSrcOp->hasTrait...)` instead, then set `isBlockArg`.

https://github.com/llvm/llvm-project/pull/124724


More information about the Mlir-commits mailing list