[openmp][mlir] Lower parallel if to new fork_call_if function.
authorDavid Truby <david.truby@arm.com>
Tue, 22 Nov 2022 13:32:47 +0000 (13:32 +0000)
committerDavid Truby <david.truby@arm.com>
Fri, 9 Dec 2022 14:23:27 +0000 (14:23 +0000)
commitb72f1ec9fbb14cd7d2f5112d2c52ef5cdd1aa94a
tree6d49423d2ef1fe20e529fb30c39b19a29480b9b0
parente7328a9eb22307d80f86f668a75c2b082ee8636e
[openmp][mlir] Lower parallel if to new fork_call_if function.

This patch adds a new runtime function `fork_call_if` and uses that
to lower parallel if statements when going through OpenMPIRBuilder.

This fixes an issue where the OpenMPIRBuilder passes all arguments to
fork_call as a struct but this struct is not filled corretly in the
non-if branch by handling the fork inside the runtime.

Differential Revision: https://reviews.llvm.org/D138495
llvm/include/llvm/Frontend/OpenMP/OMPKinds.def
llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp
llvm/unittests/Frontend/OpenMPIRBuilderTest.cpp
mlir/test/Target/LLVMIR/openmp-llvm.mlir
openmp/runtime/src/kmp.h
openmp/runtime/src/kmp_csupport.cpp
openmp/runtime/test/lit.cfg
openmp/runtime/test/parallel/omp_parallel_if.c