This is an archive of the discontinued LLVM Phabricator instance.

[flang][fir] Add structured FIR op translation pass.
AbandonedPublic

Authored by schweitz on Jan 28 2021, 3:18 PM.

Details

Summary

FIR contains some special high-level control-flow operations. This pass converts these operations into basic blocks with compare and branch terminators. That is, a primitive control-flow graph.

Contributors: Eric Schweitz, Rajan Walia, Zachary Selk, Sameeran Joshi, Sourabh Singh Tomar

These diffs depend upon D95402.

Diff Detail

Event Timeline

schweitz created this revision.Jan 28 2021, 3:18 PM
schweitz requested review of this revision.Jan 28 2021, 3:18 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 28 2021, 3:18 PM
schweitz retitled this revision from [flang][fir] Add structured FIR op lowering pass. to [flang][fir] Add structured FIR op translation pass..Jan 28 2021, 3:20 PM
mehdi_amini added inline comments.Jan 28 2021, 5:33 PM
flang/lib/Optimizer/Transforms/PassDetail.h
18

I suspect we're missing the TableGen code to generate this file in this patch?

flang/lib/Optimizer/Transforms/RewriteLoop.cpp
29

Can you make these "pass options"? https://mlir.llvm.org/docs/PassManagement/#instance-specific-pass-options
In general MLIR Passes can be free of global variables, which enables generating standalone reproducer on failures.

40

Could you lower to scf.for and rely on existing scf->CFG conversion?

Same question for the if below.

flang/test/Fir/loop01.fir
1

Is tco the actual fir-opt tool? (why not adopting the standard naming by the way?).

I'd expect an option with pass pipeline (or a pass invocation) to be specified on the command line here: the test should run only a single pass.

schweitz abandoned this revision.Jan 29 2021, 2:52 PM