[Mlir-commits] [mlir] [mlir] Fix integer overflow in ShapedType::getNumElements (PR #178395)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Wed Jan 28 05:55:27 PST 2026


mugiwaraluffy56 wrote:

Could someone review this MLIR patch? It fixes undefined behavior (signed integer overflow) in `ShapedType::getNumElements()` by using checked arithmetic and adds a `tryGetNumElements()` API that returns `std::optional`.

cc @ftynse @joker-eph @River707 (MLIR reviewers)

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


More information about the Mlir-commits mailing list