[PATCH] D108001: [OpenMP][Fix] Fix disable spmdization option

Giorgis Georgakoudis via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 12 14:49:56 PDT 2021


ggeorgakoudis created this revision.
Herald added subscribers: ormris, guansong, hiraditya, yaxunl.
ggeorgakoudis requested review of this revision.
Herald added a reviewer: jdoerfert.
Herald added subscribers: llvm-commits, sstefan1.
Herald added a project: LLVM.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D108001

Files:
  llvm/lib/Transforms/IPO/OpenMPOpt.cpp


Index: llvm/lib/Transforms/IPO/OpenMPOpt.cpp
===================================================================
--- llvm/lib/Transforms/IPO/OpenMPOpt.cpp
+++ llvm/lib/Transforms/IPO/OpenMPOpt.cpp
@@ -2834,10 +2834,6 @@
     // to avoid other parts using the current constant value for simpliication.
     auto &OMPInfoCache = static_cast<OMPInformationCache &>(A.getInfoCache());
 
-    // If we have disabled SPMD-ization, stop
-    if (DisableOpenMPOptSPMDization)
-      SPMDCompatibilityTracker.indicatePessimisticFixpoint();
-
     Function *Fn = getAnchorScope();
     if (!OMPInfoCache.Kernels.count(Fn))
       return;
@@ -2976,6 +2972,9 @@
         dyn_cast<ConstantInt>(KernelInitCB->getArgOperand(InitIsSPMDArgNo));
     if (IsSPMDArg && !IsSPMDArg->isZero())
       SPMDCompatibilityTracker.indicateOptimisticFixpoint();
+    // This is a generic region but SPMDization is disabled so stop tracking.
+    else if (DisableOpenMPOptSPMDization)
+      SPMDCompatibilityTracker.indicatePessimisticFixpoint();
   }
 
   /// Modify the IR based on the KernelInfoState as the fixpoint iteration is


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D108001.366118.patch
Type: text/x-patch
Size: 1105 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210812/35e53f96/attachment.bin>


More information about the llvm-commits mailing list