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

via flang-commits flang-commits at lists.llvm.org
Wed May 14 06:39:21 PDT 2025


tmjbios wrote:

Thanks for the poke, Kiran.

Cray Compiler Environment documentation link: https://cpe.ext.hpe.com/docs/latest/cce/index.html

Our syntax is slightly different
```
!DIR$ PREFETCH [([lines(num)][, level(num)] [, write][, nt])] var[, var]...
```

With this provided example showing it in practice:
```
real*8 a(m,n), b(n,p), c(m,p), arow(n)
...
do j = 1, p
!dir$ prefetch (lines(3), nt) arow(1),b(1,j)
    do k = 1, n, 4
!dir$ prefetch (nt) arow(k+24),b(k+24,j)
        c(i,j) = c(i,j) + arow(k) * b(k,j)
        c(i,j) = c(i,j) + arow(k+1) * b(k+1,j)
        c(i,j) = c(i,j) + arow(k+2) * b(k+2,j)
        c(i,j) = c(i,j) + arow(k+3) * b(k+3,j)
    enddo
enddo
```

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


More information about the flang-commits mailing list