This is an archive of the discontinued LLVM Phabricator instance.

[fir] Add cfg conversion pass
ClosedPublic

Authored by clementval on Oct 4 2021, 12:50 PM.

Details

Summary

This patch upstream the cfg conversion pass. This pass
rewrite FIR loop-like operation to a CFG.

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

Co-authored-by: Jean Perier <jperier@nvidia.com>

Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
Co-authored-by: V Donaldson <vdonaldson@nvidia.com>

Diff Detail

Event Timeline

clementval created this revision.Oct 4 2021, 12:50 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 4 2021, 12:50 PM
Herald added a subscriber: mgorny. · View Herald Transcript
clementval requested review of this revision.Oct 4 2021, 12:50 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 4 2021, 12:50 PM
mehdi_amini added inline comments.Oct 4 2021, 1:05 PM
flang/lib/Optimizer/Transforms/RewriteLoop.cpp
30

Please replace these with pass options.

297

This actually really seems like this option does not belong here: if someone wants to disable cfg-conversion in the compiler, then the proper plumbing is to have this option on the pass manager builder so that the pass does not get added to the pipeline.

clementval updated this revision to Diff 377110.Oct 5 2021, 1:10 AM

Move always-execute-loop-body option to the TableGen file.
Remove disable-cfg-conversion option.

clementval marked 2 inline comments as done.Oct 5 2021, 1:10 AM
clementval added inline comments.
flang/lib/Optimizer/Transforms/RewriteLoop.cpp
30

Done.

297

Right it makes more sense. Just removed the option.

schweitz added inline comments.Oct 5 2021, 3:02 PM
flang/lib/Optimizer/Transforms/RewriteLoop.cpp
297

We'll need a way to enable and disable the passes in the test tools and without having to specify the entire pipeline.

mehdi_amini added inline comments.Oct 5 2021, 4:29 PM
flang/lib/Optimizer/Transforms/RewriteLoop.cpp
297

Which test tools? Ultimately the option will have to be pushed there (in whatever abstraction used to build the pipeline there)

clementval marked 2 inline comments as done.Oct 7 2021, 12:50 AM
clementval added inline comments.
flang/lib/Optimizer/Transforms/RewriteLoop.cpp
297

We have a test tool that is similar to mlir-translate but for FIR of course. Not upstreamed yet.

schweitz accepted this revision.Oct 12 2021, 10:23 AM
This revision is now accepted and ready to land.Oct 12 2021, 10:23 AM
This revision was automatically updated to reflect the committed changes.