This is an archive of the discontinued LLVM Phabricator instance.

[mlir] Lower complex.power and complex.rsqrt to standard dialect.
ClosedPublic

Authored by bixia on Jun 7 2022, 2:51 PM.

Details

Summary

Add conversion tests and correctness tests.

Diff Detail

Event Timeline

bixia created this revision.Jun 7 2022, 2:51 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 7 2022, 2:51 PM
bixia requested review of this revision.Jun 7 2022, 2:51 PM
ftynse added a subscriber: ftynse.Jun 7 2022, 2:58 PM

Fly-by comment: standard dialect is no more, we should rename this pass, the related files and so on.

LGTM, but leaving the approval to our numerical expert

Also +1 on what Alex said, but that should be done in a separate refactoring that changes the name and switches....
(which can always have a wider impact than one thinks...)

mlir/lib/Conversion/ComplexToStandard/ComplexToStandard.cpp
927

In this block of code, it would be helpful if you call out the subexpressions shown above explicitly, just to make reading this code easier on the eye

pifon2a accepted this revision.Jun 8 2022, 2:35 AM
pifon2a added inline comments.
mlir/test/Conversion/ComplexToStandard/convert-to-standard.mlir
738–775

I do not think that this verbose test adds some value here. The integration test does. Could you remove in these two tests everything but CHECK-LABEL lines to know that the lowering happened but without all these details?

This revision is now accepted and ready to land.Jun 8 2022, 2:35 AM
ftynse added inline comments.Jun 8 2022, 2:44 AM
mlir/lib/Conversion/ComplexToStandard/ComplexToStandard.cpp
909–911

Top-level comments should use three slashes.

916

MLIR uses camelCase names, please fix here and below.

mlir/test/Conversion/ComplexToStandard/convert-to-standard.mlir
697

Please add the newline

bixia updated this revision to Diff 435203.Jun 8 2022, 9:13 AM
bixia marked 4 inline comments as done.

Address review comments: use camelCase; add more comments; remove check for generated code in tests.

mlir/test/Conversion/ComplexToStandard/convert-to-standard.mlir
697

The file before this PR doesn't have a newline either. But add a newline anyway.