How can I generate FIR code given a Fortran program using llvm?
It seems that there currently no way to do this with the current flang frontend in the latest release candidate (llvmorg-11.0.0-rc1). If so, is there an easy alternative to do so?
Summary of What I Found:
I’ve currently been trying to play a little with MLIR, more specifically with FIR, which is the Fortran dialect in MLIR.
From what I’ve read it seems like there are (or were) multiple Fortran frontends related to LLVM.
It appears that the one which is currently under the llvm-project GitHub is the former flang-compiler/f18 that was merged into llvm-project under the name flang. But this issue appears to indicate that the codegen part from the F18 frontend has not been merged yet and is only available on a currently active fork of the llvm-project.
There’s also a more recent Fortran frontend, entitled FC, being developed for LLVM which appears to support FIR generation despite not being officially a part of the llvm-project. I’ve tried compiling this project but had some issues with MLIR dependencies.