[flang-dev] RFC: Upstreaming fir-dev in small chunks of functionality

David Truby via flang-dev flang-dev at lists.llvm.org
Fri Aug 7 02:23:17 PDT 2020


Hi all,

I've just posted a few patches to Phabricator to start a conversaton on
another way forward for upstreaming from fir-dev. What I'm trying to do
with these patches is upstream small chunks of codegen functionality
with the ability to end to end test the functionality being upstreamed.
To that end I've added here only enough code to codegen empty
subroutines and empty programs, and added lit tests for Fortran->FIR,
FIR->LLVM and Fortran->LLVM.

I've split the patches in 3 parts, one to add the relevant code to the
tco tool to allow us to lower subroutines to LLVM IR, one to add (a
stripped down version of) the bbc tool and one to add lowering from PFT
to fir. You can find these patches here:
https://reviews.llvm.org/D85508
https://reviews.llvm.org/D85509
https://reviews.llvm.org/D85510

These patches could then be built on with other patches adding
functionality in similar chunks (e.g. a possible next step would be to
add handling of functions with single return statements).

I've tried not to diverge from fir-dev much when moving code over,
however in some places I have omitted classes and hand-inlined their
functions where only 1 or 2 simple functions are called in the
subroutine code generation in order to keep the diff small. Eventually
(if we follow this path) when we come to add more functionality those
classes would be added back in.

What do people think of upstreaming in this way? Is this a possible way
for us to get the upstreaming process moving forward?

Thanks!
David Truby


More information about the flang-dev mailing list