[flang-commits] [flang] [flang] Use outermost fir.dummy_scope for TBAA of local allocations. (PR #146006)

via flang-commits flang-commits at lists.llvm.org
Fri Jun 27 01:00:30 PDT 2025


https://github.com/jeanPerier approved this pull request.

Thank you Slava!
Just one question to better understand the change.

Also, I think that if this change were to pessimize performance, we could also maybe fix the situation by moving the fir.declare of the result before the call. With your explanation, I realize that the situation is likely very specific to function results, because these are the only temps that we pass in a call and for which we emit the declare after the call. It is likely not a correctness issue to mislabel temps created in `test` after the call to `foo` as belonging to bar since they cannot be used in bar via the dummy (since the alloca will always be after the call).
Although it is still weird to label such temps from `test` as belonging to `bar`, so your change makes more sense to me.

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


More information about the flang-commits mailing list