[flang-commits] [flang] [flang] Add fir.declare handling in --fir-to-llvm-ir (PR #93487)

via flang-commits flang-commits at lists.llvm.org
Tue May 28 00:25:12 PDT 2024


https://github.com/jeanPerier commented:

Why not running the "-cg-rewrite" as usual before the fir-to-llvm pass? This is required for all operations that may have fir.shape/shift/sahepshift arguments such as fir.declare.

Your change would not work if the declare had such shape argument since shape type are not meant to be translated in codegen.cpp.

`fir-opt -o - -cg-rewrite="preserve-declare=true" --fir-to-llvm-ir` will rewrite the fir.declare to an `fircg.ext_declare` later dealt with in fir-to-llvm-ir. `fir-opt -o - -cg-rewrite --fir-to-llvm-ir` will get rid of it in the cg-rewrite pass before codegen.

https://github.com/llvm/llvm-project/pull/93487


More information about the flang-commits mailing list