[all-commits] [llvm/llvm-project] 192439: [mlir][Complex] Fix bug in `MergeComplexBitcast` (...

Matthias Springer via All-commits all-commits at lists.llvm.org
Mon Dec 4 17:25:33 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 192439db6e3fcccf98c850bda1b970a11c590bbb
      https://github.com/llvm/llvm-project/commit/192439db6e3fcccf98c850bda1b970a11c590bbb
  Author: Matthias Springer <me at m-sp.org>
  Date:   2023-12-05 (Tue, 05 Dec 2023)

  Changed paths:
    M mlir/lib/Dialect/Complex/IR/ComplexOps.cpp
    M mlir/test/Dialect/Complex/invalid.mlir

  Log Message:
  -----------
  [mlir][Complex] Fix bug in `MergeComplexBitcast` (#74271)

When two `complex.bitcast` ops are folded and the resulting bitcast is a
non-complex -> non-complex bitcast, an `arith.bitcast` should be
generated. Otherwise, the generated `complex.bitcast` op is invalid.

Also remove a pattern that convertes non-complex -> non-complex
`complex.bitcast` ops to `arith.bitcast`. Such `complex.bitcast` ops are
invalid and should not appear in the input.

Note: This bug can only be triggered by running with `-debug` (which
will should intermediate IR that does not verify) or with
`MLIR_ENABLE_EXPENSIVE_PATTERN_API_CHECKS` (#74270).




More information about the All-commits mailing list