This is an archive of the discontinued LLVM Phabricator instance.

[flang] Basic local variable lowering
ClosedPublic

Authored by clementval on Feb 4 2022, 2:07 AM.

Details

Summary

This patch add lowering for simple local variable.

  • The signatures in ConvertType.h have been simplified to take advantage of the AbstractConverter.
  • The lowering make use of the allocateLocal from the FirOpBuilder.

This lowering is used in patch D118982

This patch is part of the upstreaming effort from fir-dev branch.

Diff Detail

Event Timeline

clementval created this revision.Feb 4 2022, 2:07 AM
Herald added a project: Restricted Project. · View Herald Transcript
clementval requested review of this revision.Feb 4 2022, 2:07 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 4 2022, 2:07 AM
clementval updated this revision to Diff 405905.Feb 4 2022, 2:56 AM

Remove test

clementval retitled this revision from [flang] Local variable lowering for quiet STOP stmt to [flang] Basic local variable lowering.Feb 4 2022, 3:02 AM
clementval edited the summary of this revision. (Show Details)
kiranchandramohan accepted this revision.Feb 4 2022, 5:25 AM

LGTM. Have suggested a few Nits.

flang/include/flang/Lower/ConvertVariable.h
30

Nit: AbstractConverter's

31

Nit: from

flang/lib/Lower/Bridge.cpp
218

Nit: what is a primaryResult?

flang/lib/Lower/ConvertExpr.cpp
47

Nit: Can this be skipped/TODOed for now? Also not clear to me why there is no load here.

49–51

Nit: Can this be skipped/TODOed for now? Also not clear to me why there is no load here.

52

Assuming this load is the one we require for the STOP test.

This revision is now accepted and ready to land.Feb 4 2022, 5:25 AM
clementval updated this revision to Diff 405935.Feb 4 2022, 5:43 AM
clementval marked 5 inline comments as done.
clementval edited the summary of this revision. (Show Details)

Address comments

clementval marked an inline comment as done.Feb 4 2022, 5:44 AM
clementval added inline comments.
jeanPerier accepted this revision.Feb 4 2022, 6:04 AM
schweitz accepted this revision.Feb 4 2022, 2:06 PM
This revision was automatically updated to reflect the committed changes.
clementval marked an inline comment as done.