[all-commits] [llvm/llvm-project] 4128cf: [flang][acc] Lower do and do concurrent loops spec...
Razvan Lupusoru via All-commits
all-commits at lists.llvm.org
Tue Jul 29 10:03:45 PDT 2025
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 4128cf3b26cff997f1f315ee571cbc7110bc250c
https://github.com/llvm/llvm-project/commit/4128cf3b26cff997f1f315ee571cbc7110bc250c
Author: Razvan Lupusoru <razvan.lupusoru at gmail.com>
Date: 2025-07-29 (Tue, 29 Jul 2025)
Changed paths:
M flang/include/flang/Lower/OpenACC.h
M flang/lib/Lower/Bridge.cpp
M flang/lib/Lower/OpenACC.cpp
A flang/test/Lower/OpenACC/Todo/do-loops-to-acc-loops-todo.f90
A flang/test/Lower/OpenACC/do-loops-to-acc-loops.f90
M mlir/include/mlir/Dialect/OpenACC/OpenACCOps.td
M mlir/lib/Dialect/OpenACC/IR/OpenACC.cpp
Log Message:
-----------
[flang][acc] Lower do and do concurrent loops specially in acc regions (#149614)
When OpenACC is enabled and Fortran loops are annotated with `acc loop`,
they are lowered to `acc.loop` operation. And rest of the contained
loops use the normal FIR lowering path.
Hovever, the OpenACC specification has special provisions related to
contained loops and their induction variable. In order to adhere to
this, we convert all valid contained loops to `acc.loop` in order to
store this information appropriately.
The provisions in the spec that motivated this change (line numbers are
from OpenACC 3.4):
- 1353 Loop variables in Fortran do statements within a compute
construct are predetermined to be private to the thread that executes
the loop.
- 3783 When do concurrent appears without a loop construct in a kernels
construct it is treated as if it is annotated with loop auto. If it
appears in a parallel construct or an accelerator routine then it is
treated as if it is annotated with loop independent.
By valid loops - we convert do loops and do concurrent loops which have
induction variable. Loops which are unstructured are not handled.
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