aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/Module.cpp
diff options
context:
space:
mode:
authorKareem Ergawy <kareem.ergawy@amd.com>2025-03-07 05:44:39 +0100
committerGitHub <noreply@github.com>2025-03-07 05:44:39 +0100
commit9543e9e9270e01f2c7311b571246c6ea105bcdb0 (patch)
tree59e70f030d019bb1f761fdc4a6140165e7f3a0f3 /llvm/lib/IR/Module.cpp
parente15545cad8297ec7555f26e5ae74a9f0511203e7 (diff)
downloadllvm-9543e9e9270e01f2c7311b571246c6ea105bcdb0.zip
llvm-9543e9e9270e01f2c7311b571246c6ea105bcdb0.tar.gz
llvm-9543e9e9270e01f2c7311b571246c6ea105bcdb0.tar.bz2
[flang][OpenMP] Handle pre-detemined `lastprivate` for `simd` (#129507)
This PR tries to fix `lastprivate` update issues in composite constructs. In particular, pre-determined `lastprivate` symbols are attached to the wrong leaf of the composite construct (the outermost one). When using delayed privatization (should be the default mode in the future), this results in trying to update the `lastprivate` symbol in the wrong construct (outside the `omp.loop_nest` op). For example, given the following input: ```fortran !$omp target teams distribute parallel do simd collapse(2) private(y_max) do i=x_min,x_max do j=y_min,y_max enddo enddo ``` Without the fixes introduced in this PR, the `DataSharingProcessor` tries to generate the `lastprivate` update ops in the `parallel` op since this is the op for which the DSP instance is created. The fix consists of 2 main parts: 1. Instead of creating a single DSP instance, one instance is created for the leaf constructs that might need privatization (whether for explicit, implicit, or pre-determined symbols). 2. When generating the `lastprivate` comparison ops, we don't directly use the SSA values of the UBs and steps. Instead, we regenerated these SSA values from the original loop bounds' expressions. We have to do this to avoid using `host_eval` values in the `lastprivate` comparison logic which is illegal.
Diffstat (limited to 'llvm/lib/IR/Module.cpp')
0 files changed, 0 insertions, 0 deletions