This is an archive of the discontinued LLVM Phabricator instance.

[Flang][OpenMP] Fix loop index privatisation with HLFIR
ClosedPublic

Authored by kiranchandramohan on Jul 31 2023, 10:14 AM.

Details

Summary

Loop index variables are privatised for a worksharing loop.
The alloca ops of the privatised index are hoisted to the
entry block of the outlineable region or parent function.
With HLFIR, the hlfir.declare should be created in the same
place as the alloca op. To achieve this the alloc and the
hflir.declare should be created in the same place. A new
function is created in OpenMP.cpp for this purpose.

Diff Detail