This is an archive of the discontinued LLVM Phabricator instance.

Implement test pass ComplexToStandard using 1:N type conversions.

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



This patch imports, extends the test
pass introduced in that patch to decompose complex<T>, and add test
cases that check that decomposition.

This patch 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:* I have created in the meantime,
which only has the additions related to complex, which is what I actually
wanted. I think that this diff is now superfluous.

Diff Detail

Event Timeline

ingomueller-net created this revision.Mar 7 2023, 6:30 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 7 2023, 6:30 AM
ingomueller-net requested review of this revision.Mar 7 2023, 6:30 AM
ingomueller-net retitled this revision from Implement test pass ComplexToStandard using 1:N type converions. to Implement test pass ComplexToStandard using 1:N type conversions..Mar 7 2023, 6:38 AM
ingomueller-net edited the summary of this revision. (Show Details)
ingomueller-net abandoned this revision.Mar 28 2023, 2:50 AM

Abandoning since I only opened it because I didn't understand how Phabricator really works...