[Mlir-commits] [mlir] [mlir] Add `isStatic`* size check for `ShapedType`s. NFCI. (PR #147085)
Jakub Kuderski
llvmlistbot at llvm.org
Mon Jul 7 07:28:35 PDT 2025
================
@@ -221,7 +221,17 @@ def ShapedTypeInterface : TypeInterface<"ShapedType"> {
/// Whether the given shape has any size that indicates a dynamic dimension.
static bool isDynamicShape(ArrayRef<int64_t> dSizes) {
- return any_of(dSizes, [](int64_t dSize) { return isDynamic(dSize); });
+ return llvm::any_of(dSizes, isDynamic);
+ }
+
+ /// Whether the given dimension size indicates a statically-sized dimension.
+ static constexpr bool isStatic(int64_t dValue) {
+ return !isDynamic(dValue);
----------------
kuhar wrote:
MLIR is known for having notoriously long stack traces. I usually try to flatten call graphs in contexts that could end up in stack traces, but I think here specifically this will always be a leaf function that cannot segfault or assert. I don't think it matters in this instance.
https://github.com/llvm/llvm-project/pull/147085
More information about the Mlir-commits
mailing list