[Mlir-commits] [mlir] [mlir][memref] Enforce consistent reinterpret_cast metadata (PR #217338)
Oleksandr Alex Zinenko
llvmlistbot at llvm.org
Sat Aug 22 03:28:58 PDT 2026
================
@@ -2108,15 +2093,18 @@ LogicalResult ReinterpretCastOp::verify() {
"result")))
return failure();
+ auto printDynamicOrValue = [](int64_t value) {
+ return ShapedType::isDynamic(value) ? std::string("dynamic")
+ : std::to_string(value);
+ };
----------------
ftynse wrote:
It's not a good idea to materialize an std::string as it requires a costly dynamic allocation. Instead, this should use streams. If really needed, create a wrapper struct and overload `operator<<` to use it with streams. I highly suspect there is some logic for this somewhere already.
https://github.com/llvm/llvm-project/pull/217338
More information about the Mlir-commits
mailing list