This is an archive of the discontinued LLVM Phabricator instance.

[mlir] support complex type in DenseElementsAttr::get.
ClosedPublic

Authored by python3kgae on Feb 12 2023, 9:20 AM.

Details

Summary

Fixes #60662 https://github.com/llvm/llvm-project/issues/60662

Allow ComplexType when create DenseElementsAttr.
Also allow build ConstantOp for integer complex.

Diff Detail

Event Timeline

python3kgae created this revision.Feb 12 2023, 9:20 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 12 2023, 9:20 AM
python3kgae requested review of this revision.Feb 12 2023, 9:20 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 12 2023, 9:20 AM
mehdi_amini added inline comments.Feb 12 2023, 12:40 PM
mlir/lib/Dialect/Complex/IR/ComplexOps.cpp
37

Nit: testing for fre is redundant here.

mlir/lib/IR/BuiltinAttributes.cpp
903

The assertions string could come quite confusing considering it checks for an ArrayAttr

python3kgae marked an inline comment as done.

Update to fix issues mentioned in comments.

akuegel accepted this revision.Feb 12 2023, 10:48 PM
This revision is now accepted and ready to land.Feb 12 2023, 10:48 PM
This revision was landed with ongoing or failed builds.Feb 13 2023, 6:41 AM
This revision was automatically updated to reflect the committed changes.
python3kgae marked an inline comment as done.