This is an archive of the discontinued LLVM Phabricator instance.

[Flang][OpenMP] Fix HLFIR lowering for commonblock threadprivate
ClosedPublic

Authored by kiranchandramohan on Aug 16 2023, 4:20 AM.

Details

Summary

Commonblock names are not variables, but they can be marked as
threadprivate in OpenMP. This requires the commonblock name to
be bound to the address of the Commonblock. hlfir.declares are
not required for these, but we should be able to retrieve the
mlir Value corresponding to the Commonblock. This patch enables
this by special casing the Commonblocks like procedures.

Diff Detail

Event Timeline

Herald added projects: Restricted Project, Restricted Project. · View Herald Transcript
kiranchandramohan requested review of this revision.Aug 16 2023, 4:20 AM

The atlernative implementations are :
-> Have separate API functions in the converter for binding and retrieving mlir Values for non-variable symbols.
-> Making the hlfir variable op interface aware of commonblocks (This did not make sense since commonblocks are not variables).

tblah accepted this revision.Aug 17 2023, 5:53 AM

LGTM, thanks!

This revision is now accepted and ready to land.Aug 17 2023, 5:53 AM
vzakhari accepted this revision.Aug 21 2023, 7:43 AM

Hi @kiranchandramohan! Yes, it looks okay to me. Thank you for the changes!