This is an archive of the discontinued LLVM Phabricator instance.

[flang][hlfir][NFC] refactor transformational intrinsic lowering
ClosedPublic

Authored by tblah on Jun 30 2023, 10:09 AM.

Details

Summary

The old code had overgrown itself and become difficult to read and
modify. I've rewritten it and moved it into its own translation unit.

I moved PreparedActualArgument to the header file for the
transformational intrinsic lowering. Logically, it belongs in
ConvertCall.h, but putting it there would create a circular dependency
between HlfirIntrinsics and ConvertCall.

Diff Detail

Event Timeline

tblah created this revision.Jun 30 2023, 10:09 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald Transcript
tblah requested review of this revision.Jun 30 2023, 10:09 AM
vzakhari accepted this revision.Jun 30 2023, 10:23 AM

Thank you, @tblah!
I might have missed something, but this looks like an NFC - is it?

flang/include/flang/Lower/HlfirIntrinsics.h
91

nit: please add newline

flang/lib/Lower/HlfirIntrinsics.cpp
3

nit: please concat with the previous line

297

nit: please add newline

This revision is now accepted and ready to land.Jun 30 2023, 10:23 AM
cabreraam added inline comments.Jun 30 2023, 11:49 AM
flang/include/flang/Lower/HlfirIntrinsics.h
91

When I've tried to add newlines to the end of files, the buildbot will fail it's pre-merge check because of clang-format. Am I missing something?

tblah updated this revision to Diff 536705.Jul 3 2023, 3:32 AM
tblah marked an inline comment as done.

Fix opening comment split over two lines

tblah retitled this revision from [flang][hlfir] refactor transformational intrinsic lowering to [flang][hlfir][NFC] refactor transformational intrinsic lowering.Jul 3 2023, 5:54 AM
tblah added inline comments.
flang/include/flang/Lower/HlfirIntrinsics.h
91

Yes clang-format just removed the newline again after I added it.

vzakhari accepted this revision.Jul 3 2023, 8:54 AM

Thank you for the follow-ups.

flang/include/flang/Lower/HlfirIntrinsics.h
18

Sorry, I missed it before and it is probably not that important right now: you may want to guard the file content with ifndef FORTRAN_LOWER_....

tblah updated this revision to Diff 536794.Jul 3 2023, 9:19 AM

Add include guards

vzakhari accepted this revision.Jul 3 2023, 9:21 AM
vzakhari added inline comments.
flang/include/flang/Lower/HlfirIntrinsics.h
91

nit: typo in // FORTRAN_LOWER_HLFIRINTRINAICS_H

tblah added a comment.Jul 3 2023, 9:21 AM

Thank you for the follow-ups.

Doh! Thanks for catching this

tblah marked an inline comment as done.Jul 3 2023, 9:31 AM
tblah added inline comments.
flang/include/flang/Lower/HlfirIntrinsics.h
91

Thanks, I'll fix this before merging

jeanPerier accepted this revision.Jul 3 2023, 11:58 PM
This revision was automatically updated to reflect the committed changes.
tblah marked an inline comment as done.