[all-commits] [llvm/llvm-project] 901e54: [mlir][Math] Fix math-expand-ops crash on math.ctl...

Darshan Bhat via All-commits all-commits at lists.llvm.org
Sun Feb 15 15:57:06 PST 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 901e543c15bd5e46a33dc19354a35da0278aaf7b
      https://github.com/llvm/llvm-project/commit/901e543c15bd5e46a33dc19354a35da0278aaf7b
  Author: Darshan Bhat <darshanbhatsirsi at gmail.com>
  Date:   2026-02-15 (Sun, 15 Feb 2026)

  Changed paths:
    M mlir/lib/Dialect/Math/Transforms/ExpandOps.cpp
    M mlir/test/Dialect/Math/expand-math.mlir

  Log Message:
  -----------
  [mlir][Math] Fix math-expand-ops crash on math.ctlz with index type (#181539)

Fixes #179847
math.ctlz expansion called getIntOrFloatBitWidth() on the operand type
without checking. Index type has no fixed bitwidth and is not int/float,
so the assertion in Type::getIntOrFloatBitWidth() could fire.

- In convertCtlzOp, bail out with notifyMatchFailure when the element
type is not integer or float, so expansion is only applied to types with
a defined bitwidth.
- Add a test in expand-math.mlir that math.ctlz on index is left
unchanged by the pass (no crash, op preserved).



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