This is an archive of the discontinued LLVM Phabricator instance.

[flang][hlfir] Generate explicit HLFIR type cast for implicit logical<->integer conversion.
ClosedPublic

Authored by vzakhari on May 3 2023, 9:41 AM.

Details

Summary

hlfir.assign, in general, ends up calling the Assign runtime that asserts
that the types of LHS and RHS match. In case of implicit logical<->integer
conversions (allowed as an extension) the operands of hlfir.assign
have non-matching types. This change makes sure that the lowering
produces explicit type cast (either as a scalar fir.convert or
as a hlfir.elemental producing array expression).

Diff Detail

Event Timeline

vzakhari created this revision.May 3 2023, 9:41 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 3 2023, 9:41 AM
vzakhari requested review of this revision.May 3 2023, 9:41 AM
jeanPerier accepted this revision.May 4 2023, 1:03 AM

Looks great, thank!

This revision is now accepted and ready to land.May 4 2023, 1:03 AM