[Mlir-commits] [mlir] [mlir][Interfaces] Track and infer no-overflow flags in integer ranges (PR #191777)
Mehdi Amini
llvmlistbot at llvm.org
Tue Apr 14 10:21:37 PDT 2026
================
@@ -27,6 +27,18 @@
using namespace mlir;
using namespace mlir::dataflow;
+static ConstantIntRanges makeStaticIndexConstantRange(int32_t indexBitwidth,
+ int64_t value) {
+ ConstantIntRanges range =
+ ConstantIntRanges::constant(APInt(indexBitwidth, value));
+ // For statically-known non-negative metadata constants (e.g. extents), we
+ // can safely carry both no-wrap guarantees.
+ if (range.smin().isNonNegative())
----------------
joker-eph wrote:
Also, seems to me that we should define nsw or nuw based on the particular field. It should be part of the spec whether these are signed or unsigned for each of the memref descriptor members, and the associated nsw/nuw can be applied unconditionally.
https://github.com/llvm/llvm-project/pull/191777
More information about the Mlir-commits
mailing list