[all-commits] [llvm/llvm-project] 846ad9: [mlir] Fix canonicalizer crash when folding poison...

Akun via All-commits all-commits at lists.llvm.org
Wed Sep 23 19:54:20 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 846ad9de67ebea162840cbcf66b605226be3f18d
      https://github.com/llvm/llvm-project/commit/846ad9de67ebea162840cbcf66b605226be3f18d
  Author: Akun <cubehan3 at gmail.com>
  Date:   2026-09-24 (Thu, 24 Sep 2026)

  Changed paths:
    M mlir/lib/Dialect/Utils/StaticValueUtils.cpp
    M mlir/test/Dialect/MemRef/canonicalize.mlir
    M mlir/test/Dialect/Tensor/canonicalize.mlir

  Log Message:
  -----------
  [mlir] Fix canonicalizer crash when folding poison or kDynamic-sentinel index values (#223609)

Fixes two canonicalizer crashes, both in foldDynamicIndexList:

* #223333: tensor.extract_slice with a ub.poison offset/size crashes
canonicalization. ub.poison is matched as a constant but is not an
IntegerAttr, so getConstantIntValue returns nullopt and the subsequent
dereference asserts.
* #223336: a memref.subview offset/size/stride that wraps to
ShapedType::kDynamic (INT64_MIN) crashes canonicalization. Folding
INT64_MIN into the static array collides with the "dynamic" marker,
leaving dynamic-looking entries with no matching dynamic operands;
getMixedStrides() then asserts.

Only fold an operand when it is an integer constant whose value is not
ShapedType::kDynamic; poison and sentinel values stay dynamic operands.
Since foldDynamicIndexList is shared, this hardens all its callers.

Adds regression tests in mlir/test/Dialect/MemRef/canonicalize.mlir and
mlir/test/Dialect/Tensor/canonicalize.mlir.

Fixes #223333, #223336.



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