This repository contains simple examples which have been used to compare the LLVM IR generated by the LLVM native C
and FORTRAN
compilers
The ./src
folder contains C
and FORTRAN
source code that can be compiled with
make FC=flang-new CC=clang APP=file_name OPT=<-O0,...,-Ofast>
This will generate multiple output files. LLVM IR is stored in ./ir/
, bitcode in ./bitcode/
, object files in ./lib/
, and executables in ./bin/
.
The folder ./cbindings_offloading
contains examples of how FORTRAN
subroutines can be called from OpenMP target offloading regions in C
. It is shown how functions and subroutines are called in different ways, and how the functions can be called by other names in C
.
The LLVM IR can be printed after each LLVM optimization pass with make llvmirdump
for both flang-new
anfd clang
. As flang-new
does not lower the source code directly to LLVM IR, it may be necessary to inspect other levels of intermediate representation. The MLIR from flang-new
can be printed with make mlirdump
.