[OpenMP][OMPIRBuilder] Fix LLVM IR codegen for collapsed device loop (#78708)
commit21199f9842dffa4f34b38101195c6f57d1bd4630
authorDominik Adamski <dominik.adamski@amd.com>
Mon, 22 Jan 2024 08:24:45 +0000 (22 09:24 +0100)
committerGitHub <noreply@github.com>
Mon, 22 Jan 2024 08:24:45 +0000 (22 09:24 +0100)
tree6653b3fd1670671b5634a076d384d4165b0fbb6d
parenta2caa4929e8e8a2ffff4ee5f03ab37a9be7462a0
[OpenMP][OMPIRBuilder] Fix LLVM IR codegen for collapsed device loop (#78708)

When we generate the loop body function, we need to be sure, that all
original loop counters are replaced by the new counter.

We need to save all items which use the original loop counter and then
perform replacement of the original loop counter. If we don't do it,
there is a risk that some values are not updated.
llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp
mlir/test/Target/LLVMIR/omptarget-wsloop-collapsed.mlir [new file with mode: 0644]
openmp/libomptarget/test/offloading/fortran/target-parallel-do-collapse.f90 [new file with mode: 0644]