[all-commits] [llvm/llvm-project] ccf461: [mlir] disable folding collapse expand to cast (#1...

ofri frishman via All-commits all-commits at lists.llvm.org
Thu Feb 5 12:32:06 PST 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ccf46155a7efc131519a07f3ba62bcba5da65fa2
      https://github.com/llvm/llvm-project/commit/ccf46155a7efc131519a07f3ba62bcba5da65fa2
  Author: ofri frishman <ofri4321 at gmail.com>
  Date:   2026-02-05 (Thu, 05 Feb 2026)

  Changed paths:
    M mlir/include/mlir/Dialect/Utils/ReshapeOpsUtils.h
    M mlir/test/Dialect/MemRef/canonicalize.mlir

  Log Message:
  -----------
  [mlir] disable folding collapse expand to cast (#179209)

Collapsing expand(collapse(src)) to cast(src) is supported in cases
where the source and result are cast compatible but not equal. When the
source has dynamic dimensions this leads to cases where the cast is
enabled even though certain dimensions cast from static to dynamic when
the dynamic size is not assured to be equal to the static size.
Currently blocking applying this folding when the source has dynamic
dimensions to preserve correctness.
In the future it could be possible to enable some cases of folding when
not all dimensions of the source are static.
Such cases could be when:
  1) expand and collapse happened on non dynamic dims
  2) expand and collapse on dynamic dims could be folded to no op



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