[flang-commits] [flang] [Flang] Add parser support for prefetch directive (PR #139702)

Kiran Chandramohan via flang-commits flang-commits at lists.llvm.org
Wed May 14 09:29:48 PDT 2025


kiranchandramohan wrote:

> Is there a compelling reason for Flang to be different from the major vendors? This is especially concerning when there are existing codes in the wild which will break or see significantly degraded performance if they use `flang`.

The syntax proposed here is similar to the ones that are/were supported in pgfortran and classic-flang based compilers (AOCC, Huawei compilers, Arm compilers). They all had the syntax `!$mem prefetch <var1>[,<var2>[,...]]`. This was modified for use in Flang `!$dir prefetch <var1>[,<var2>[,...]]` to match other directives. 

https://docs.nvidia.com/hpc-sdk/pgi-compilers/19.1/x86/pgi-ref-guide/index.htm#prefetch
https://developer.arm.com/documentation/101380/2404/Optimize/Directives/prefetch
https://www.amd.com/content/dam/amd/en/documents/pdfs/developer/aocc/aocc-v4.0-ga-user-guide.pdf (Section 4.1.5)


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


More information about the flang-commits mailing list