diff options
author | Tom Eccles <tom.eccles@arm.com> | 2024-07-12 10:29:21 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-12 10:29:21 +0100 |
commit | de90391ea88c51da8bcde95206f3f31ecbaf97a3 (patch) | |
tree | 5bb1820a67fe4c2f7c36a0180ac2cbd1dd8c43e8 /clang/lib/CodeGen/CodeGenModule.cpp | |
parent | 87bf82d14d7f03ce67ddd56d9da457a23c316f0e (diff) | |
download | llvm-de90391ea88c51da8bcde95206f3f31ecbaf97a3.zip llvm-de90391ea88c51da8bcde95206f3f31ecbaf97a3.tar.gz llvm-de90391ea88c51da8bcde95206f3f31ecbaf97a3.tar.bz2 |
[flang][OpenMP] Lower REDUCTION clause for SECTIONS (#97858)
The tricky bit here is that we need to generate the reduction symbol
mapping inside each of the nested SECTION constructs. This is a bit
similar to omp.canonical_loop inside of omp.wsloop, except the SECTION
constructs come from the PFT.
To make this work I moved the lowering of the SECTION constructs inside
of the lowering SECTIONS (where reduction information is still
available). This subverts the normal control flow for OpenMP lowering a
bit.
One alternative option I investigated would be to generate the SECTION
CONSTRUCTS as normal as though there were no reduction, and then to fix
them up after control returns back to genSectionsOp. The problem here is
that the code generated for the section body has the wrong symbol
mapping for the reduction variable, so all of the nested code has to be
patched up. In my prototype version this was even more hacky than what
the solution I settled upon.
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
0 files changed, 0 insertions, 0 deletions