[all-commits] [llvm/llvm-project] 9673aa: [flang][OpenACC] Don't hoist declare directive out...
khaki3 via All-commits
all-commits at lists.llvm.org
Thu Jun 11 03:05:38 PDT 2026
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 9673aae1fc67abcab756ed3f6e36dff846e8228c
https://github.com/llvm/llvm-project/commit/9673aae1fc67abcab756ed3f6e36dff846e8228c
Author: khaki3 <47756807+khaki3 at users.noreply.github.com>
Date: 2026-06-11 (Thu, 11 Jun 2026)
Changed paths:
M flang/lib/Lower/PFTBuilder.cpp
A flang/test/Lower/OpenACC/acc-declare-interface-body.f90
Log Message:
-----------
[flang][OpenACC] Don't hoist declare directive out of interface bodies (#202806)
Example:
```fortran
program main
real :: a(10, 60)
interface
subroutine compute(a)
real :: a(10, 60)
!$acc declare present(a)
end subroutine
end interface
call compute(a)
end program
```
In this code, the `!$acc declare` inside the interface body is hoisted
into the
host program unit and lowered there, where its operand (the interface
dummy)
has no IR value, so lowering aborts with "symbol is not mapped to any IR
value".
This happens because interface-body procedures are not function-like
units, so
the directive is appended to the enclosing unit's evaluation list.
Fix: track interface-body nesting in the PFT builder and do not add an
`OpenACCDeclarativeConstruct` to the enclosing unit's evaluation list
while
inside one. The directive is no longer hoisted out and is generated only
in its
proper scope (the procedure definition or a module-level declare).
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list