This is an archive of the discontinued LLVM Phabricator instance.

[Flang][OpenMP] Use fir.if instead of scf.if in lastprivate lowering
ClosedPublic

Authored by kiranchandramohan on Apr 30 2023, 6:42 AM.

Details

Summary

For finding the last iteration of a loop, or the last section an
if condition is generated. Using scf::if can cause some lowering
issues since the code contained inside it can have branches. Using
fir::if instead ensures that the fir::if is lowered into branches
along with any code contained inside that can generate branches.

Fixes #62458.

Diff Detail

Event Timeline

Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptApr 30 2023, 6:42 AM
kiranchandramohan requested review of this revision.Apr 30 2023, 6:42 AM
NimishMishra accepted this revision.May 1 2023, 7:49 AM

LGTM. Thank you for the patch. I was not aware of this problem with scf.if.

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