[all-commits] [llvm/llvm-project] b07aee: [MLIR][IntRange] Materialize known constant values...
Jeremy Kun via All-commits
all-commits at lists.llvm.org
Wed May 6 18:55:01 PDT 2026
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: b07aeece4d8b3af5578c58a2a2d4092070b92773
https://github.com/llvm/llvm-project/commit/b07aeece4d8b3af5578c58a2a2d4092070b92773
Author: Jeremy Kun <jkun at google.com>
Date: 2026-05-06 (Wed, 06 May 2026)
Changed paths:
M mlir/lib/Dialect/Arith/Transforms/IntRangeOptimizations.cpp
A mlir/test/Dialect/Arith/int-range-opts-crash.mlir
M mlir/test/lib/Dialect/Test/TestOpDefs.cpp
M mlir/test/lib/Dialect/Test/TestOps.td
Log Message:
-----------
[MLIR][IntRange] Materialize known constant values only when the value type is integer-like (#196133)
This patch came out of
https://discourse.llvm.org/t/request-for-advice-in-updating-intrange-optimziations/90685
In short, my out-of-tree dialect has region-bearing operations whose
return-like terminators semantically wrap an integer type in a
non-integer type when returning to the parent for control flow (also
this dialect that has no constant materializer). In this case,
`MaterializeKnownConstantValues` will attempt to construct integer
attributes using those non-integer types, which causes a stack trace and
prevents us from using int range optimizations on IR that contains these
ops.
This patch adds guards to the materialization step, so that if the value
that is inferred to be constant is not an integer (or shaped container
with an integer element type), no materialization is attempted.
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list