This is an archive of the discontinued LLVM Phabricator instance.

[Flang] Rework the overview document
ClosedPublic

Authored by PeteSteinfeld on Dec 16 2022, 12:07 PM.

Details

Summary

I brought the overview document up to date and added information for
most compilation phases to dump out the reeults of the phase.

Diff Detail

Event Timeline

PeteSteinfeld created this revision.Dec 16 2022, 12:07 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald Transcript
PeteSteinfeld requested review of this revision.Dec 16 2022, 12:07 PM
PeteSteinfeld retitled this revision from [Flang] Reword the overview document to [Flang] Rework the overview document.Dec 16 2022, 12:09 PM
tschuett added inline comments.
flang/docs/Overview.md
23

decorated parse tree

PeteSteinfeld added inline comments.Dec 16 2022, 7:33 PM
flang/docs/Overview.md
23

Good catch! I'll fix it.

tschuett added inline comments.Dec 17 2022, 2:46 AM
flang/docs/Overview.md
34

described

187–189

clang or flang?

Thanks for the feedback. You're a prince!

flang/docs/Overview.md
34

Another good catch. I'll fix this, too.

187–189

This sentence is not clear. I plan to change it as follows:
"Once the LLVM IR is created the flang driver invokes LLVM's exising infrastructure to generate object code and invoke a linker."

tschuett added inline comments.Dec 17 2022, 7:53 AM
flang/docs/Overview.md
187–189

My bad. The name of the executable is flang, but it links against the clang driver library.

Responding to @tschuett's excellent feedback.

For the information that is being removed, e.g. "do concurrent" or the description of ResolveNames -- is this obsolete or repeated in another document?

Looks Good. Thanks for updating this document. A few comments or questions.

flang/docs/Overview.md
58–59

Preprocessing also happens, I guess. Is it worth calling it out?

61–63

Nit: The information will also be used for generating optimization reports, debug information etc.

68

Nit: spelling : -fdebug-dump-provenance

154

We lower to FIR and other MLIR dialects (like Arith, Math, Func, OpenMP, OpenACC). But yes, From a Flang compiler perspective FIR is the backbone. With the HLFIR changes going on, we will lower to that as well.

178

Nit: Not all are optimisations, some are transformations that just create a lower-level representation.

182

Is this a bug that this option does not work with fc1 ?

This revision is now accepted and ready to land.Dec 20 2022, 2:34 AM
flang/docs/Overview.md
182

I think the -S option is required for this option and the one below to avoid invoking the linker.

flang/docs/Overview.md
92–98

Module files also?

138–139

Should the above two be listed as outputs of the Semantics processing?

Also, isn't there a type table? (for derived types)

Will you use the LLVM remarks facilities for optimisation reports?

Will you use the LLVM remarks facilities for optimisation reports?

We will reuse wherever possible. If you meant the -fsave-optimization-record option, then we will support it. In the beginning, there will be only optimisation info from LLVM, but I believe we can support FIR/MLIR optimisation info as well.

For the information that is being removed, e.g. "do concurrent" or the description of ResolveNames -- is this obsolete or repeated in another document?

This information is repeated in other documents. Still, it would be good to reference them from the overview. I'll add such references.

flang/docs/Overview.md
58–59

You're right! I'll add that.

61–63

Good point. I'll add references to those.

68

Good catch. Thanks!

92–98

Yes. Thanks for pointing this out. I'll add that.

138–139

Good points. I'll make some changes.

178

Good point. I'll clarify.

182

I'm not sure if it's a bug or not.

182

Good catch. I'll add "-S".

Will you use the LLVM remarks facilities for optimisation reports?

I'm not familiar with the LLVM remarks facilities.

Will you use the LLVM remarks facilities for optimisation reports?

I'm not familiar with the LLVM remarks facilities.

You can put remarks about hit or miss optimisations into the binary.

Responding to feedback from Steve and Kiran.

This revision was automatically updated to reflect the committed changes.