This is an archive of the discontinued LLVM Phabricator instance.

[flang] Fix folding of CMPLX
ClosedPublic

Authored by klausler on Jun 2 2021, 5:01 PM.

Details

Summary

The code for folding calls to the intrinsic function CMPLX was
incorrectly dependent on the number of arguments to distinguish its
two cases (conversion from one kind of complex to another, and
composition of a complex value from real & imaginary parts).
This was wrong since the optional KIND= argument has already been
taken into account by intrinsic processing; instead, the type of
the first argument should decide the issue.

Diff Detail

Event Timeline

klausler created this revision.Jun 2 2021, 5:01 PM
klausler requested review of this revision.Jun 2 2021, 5:01 PM
PeteSteinfeld accepted this revision.Jun 2 2021, 7:42 PM
PeteSteinfeld added a subscriber: PeteSteinfeld.

All builds, tests, and looks good.

This revision is now accepted and ready to land.Jun 2 2021, 7:42 PM
jeanPerier accepted this revision.Jun 3 2021, 5:49 AM
This revision was landed with ongoing or failed builds.Jun 3 2021, 1:11 PM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptJun 3 2021, 1:11 PM