[llvm] [OpenMP][OMPIRBuilder] Add support to omp target parallel (PR #67000)

Dominik Adamski via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 20 05:27:25 PDT 2023


================
@@ -522,6 +522,7 @@ struct OMPInformationCache : public InformationCache {
   void recollectUses() {
     for (int Idx = 0; Idx < RFIs.size(); ++Idx)
       recollectUsesForFunction(static_cast<RuntimeFunction>(Idx));
+    OMPBuilder.Config.IsTargetDevice = isOpenMPDevice(OMPBuilder.M);
----------------
DominikAdamski wrote:

OpenMP optimization passes uses OMPIRBuilder to generate parallel code. This patch enables generation of the parallel code for device and host. That's why we need to specify which version of the code we need to generate.

I moved this setting to the constructor of struct OMPInformationCache : public InformationCache.

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


More information about the llvm-commits mailing list