Skip to content

Commit 4fd5d27

Browse files
Address a comment.
1 parent da37778 commit 4fd5d27

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

mlir/lib/Conversion/MeshToMPI/MeshToMPI.cpp

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -240,13 +240,12 @@ struct ConvertUpdateHaloOp
240240
auto loc = op.getLoc();
241241

242242
// convert a OpFoldResult into a Value
243-
auto toValue = [&rewriter, &loc](OpFoldResult &v) {
244-
return isa<Value>(v)
245-
? cast<Value>(v)
246-
: rewriter.create<::mlir::arith::ConstantOp>(
247-
loc,
248-
rewriter.getIndexAttr(
249-
cast<IntegerAttr>(cast<Attribute>(v)).getInt()));
243+
auto toValue = [&rewriter, &loc](OpFoldResult &v) -> Value {
244+
if (auto value = dyn_cast<Value>(v))
245+
return value;
246+
return rewriter.create<::mlir::arith::ConstantOp>(
247+
loc, rewriter.getIndexAttr(
248+
cast<IntegerAttr>(cast<Attribute>(v)).getInt()));
250249
};
251250

252251
auto dest = op.getDestination();

0 commit comments

Comments
 (0)