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

Alexey Bataev via cfe-commits cfe-commits at lists.llvm.org
Sun Sep 13 11:31:33 PDT 2026


https://github.com/alexey-bataev commented:

Check this:
```
#include <stdio.h>
int main() {
  int i = 0, j = 0, k = 0;
#pragma omp fuse looprange(1, 2)
  {
    for (i = 0; i < 10; i++) ;
    for (j = 0; j < 15; j++) ;
#pragma omp reverse
    for (k = 0; k < 5; k++) ;   // post-fusion transformation
  }
  printf("i=%d j=%d k=%d\n", i, j, k); // spec: i=10 j=15 k=5
}
```

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


More information about the cfe-commits mailing list