[all-commits] [llvm/llvm-project] a115e6: [mlir][Shape] Fix crash in BroadcastOp::fold when ...

Mehdi Amini via All-commits all-commits at lists.llvm.org
Thu Mar 5 04:24:15 PST 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a115e6bd096da9655df3541fb8161949d69cf562
      https://github.com/llvm/llvm-project/commit/a115e6bd096da9655df3541fb8161949d69cf562
  Author: Mehdi Amini <joker.eph at gmail.com>
  Date:   2026-03-05 (Thu, 05 Mar 2026)

  Changed paths:
    M mlir/lib/Dialect/Shape/IR/Shape.cpp
    M mlir/test/Dialect/Shape/canonicalize.mlir

  Log Message:
  -----------
  [mlir][Shape] Fix crash in BroadcastOp::fold when operand is ub.poison (#183931)

BroadcastOp::fold used an unchecked llvm::cast<DenseIntElementsAttr> on
each operand's folded attribute. The existing null-check only guarded
against a missing (unset) attribute, not against a non-null attribute of
a different type such as PoisonAttr (produced when an operand is
ub.poison).

Replace the unchecked casts with dyn_cast_or_null, bailing out with
nullptr (i.e. no fold) when any operand does not provide a
DenseIntElementsAttr.

Add a regression test with a ub.poison operand.

Fixes #179679



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