This is an archive of the discontinued LLVM Phabricator instance.

[Flang][OpenMP] Fix loop index privatisation in Parallel region in HLFIR
ClosedPublic

Authored by kiranchandramohan on Aug 23 2023, 4:34 AM.

Details

Summary

HLFIR lowering always adds hlfir.declare when symbols are bound to their
address allocated on the stack. Ensure that the declare is placed along
with the alloca if it is hoisted. And always return the mlir value that
is bound to the symbol (i.e the alloca in FIR lowering and the declare
in HLFIR lowering).

Context: Loop index variables in OpenMP parallel regions should be
privatised to work correctly.

Diff Detail