This is an archive of the discontinued LLVM Phabricator instance.

[mlir] Extend 1:N type conversion tests to decompose complex<T>.
AbandonedPublic

Authored by ingomueller-net on Mar 7 2023, 6:32 AM.

Details

Reviewers
nicolasvasilache
Summary

This commit extends the test pass for 1:N type conversion to convert
complex<T> into T, T. This allows to convert complex numbers to built-in
types in function signatures, adding materializations to the beginning
and end of the function body where necessary. The commit also extends
the test cases of ComplexToStandard such that the function signatures
are converted either before that conversion or after. The additional
checks show that, with very few exceptions, both orders lead to the same
result, so the 1:N type conversion composes cleanly with other
transformations. (The few exceptions are due to foldings or
canonicalizations triggered in one order but not the other. This could
be avoided by implementing a dedicated pattern application driver in the
1:N type conversion pass, instead of using applyPatternsAndFoldGreedily.)

*Update:* This patch is conceptually related to
https://reviews.llvm.org/D144469, but, for the time being, should only
illustrate the capabilities of that patch. My limited understanding of
arc/Phabricator has also led me to create
https://reviews.llvm.org/D145500, which is probably just superfluous.

Diff Detail

Event Timeline

ingomueller-net created this revision.Mar 7 2023, 6:32 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 7 2023, 6:32 AM
ingomueller-net requested review of this revision.Mar 7 2023, 6:32 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 7 2023, 6:32 AM
ingomueller-net retitled this revision from Extend test case to decompose complex<T> and add test cases. to [mlir] Extend 1:N type conversion tests to decompose complex<T>..Mar 7 2023, 6:40 AM
ingomueller-net edited the summary of this revision. (Show Details)
ingomueller-net abandoned this revision.Aug 28 2023, 2:49 AM