[Openmp-commits] [clang] [llvm] [openmp] [CLANG][OpenMP] Restore loop variable values after transformation directives (PR #214717)

Alexey Bataev via Openmp-commits openmp-commits at lists.llvm.org
Thu Oct 8 10:54:59 PDT 2026


alexey-bataev wrote:

> @alexey-bataev What should the final value of `j` be here?
> 
> ```
> volatile int n = 0;
> int i = 10, j = 10;
> #pragma omp interchange
> for (i = 0; i < n; i++)
>     for (j = 0; j < 3; j++)
>     ;
> ```
> 
> This PR currently gives `j=3`. Shouldn't be `j=10`?

Unless j is private, it should be 3, if it is private - 10

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


More information about the Openmp-commits mailing list