[flang-commits] [flang] [flang][hlfir] Do not emit extra declare for dummy used in BLOCK (PR #69184)

via flang-commits flang-commits at lists.llvm.org
Mon Oct 16 10:41:57 PDT 2023


jeanPerier wrote:

> One idea there is to explicitly save the incoming `scope` in the two `SymbolDependenceAnalysis` constructors and then in `analyze` have an early exit if the scope of the symbol being analyzed does not match that scope. I'm not completely sure if that would be ok though.

That would at likely not work with used module symbols/host associated variables whose scope may differ from the one being analyzed. I am not saying that what you are suggesting is not possible, but I would rather avoid making the PFT analysis more complex if possible. The gain seems small to me unless you have a program with thousands of host variables being used in block variable specifications.

The nicest fix should be to have instantiateVariable rely on something else to propagate the IR dummy/results and always refuse to instantiate again symbols. But it is too much refactoring for what needs to be fixed here IMHO.

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


More information about the flang-commits mailing list