This is an archive of the discontinued LLVM Phabricator instance.

[flang] Control flow graph issues
ClosedPublic

Authored by vdonaldson on Jan 3 2023, 10:41 AM.

Details

Summary

Address several issues involving control flow graph generation and structured code ops.

  • Fix a problem with constructs nested inside unstructured selection constructs. This is a general problem involving branches that are implied rather than explicit. It is addressed in the generic genFIR "wrapper" function that calls individual statement-specific genFIR calls.
  • The previous fix requires some compensating changes in IF and DO construct code lowering.
  • Streamline the code to generate explicit DO loop variable updates.
  • Fix a problem with the individual detailed genFIR calls made in the genFIR(SelectTypeConstruct) call.
  • Modify control flow graph generation to support the insertion of deallocation and finalization code when lowering most END <construct> statements.

Diff Detail

Event Timeline

vdonaldson created this revision.Jan 3 2023, 10:41 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 3 2023, 10:41 AM
vdonaldson requested review of this revision.Jan 3 2023, 10:41 AM
clementval accepted this revision.Jan 3 2023, 10:43 AM
clementval added a subscriber: clementval.

LGTM

This revision is now accepted and ready to land.Jan 3 2023, 10:43 AM
PeteSteinfeld accepted this revision.Jan 3 2023, 1:26 PM

All builds and tests correctly and looks good.