[llvm] 5b4acb2 - [OpenMP][FIX] Ensure flag to disable de-globalization works properly

Johannes Doerfert via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 7 21:43:35 PST 2022


Author: Johannes Doerfert
Date: 2022-03-07T23:43:05-06:00
New Revision: 5b4acb20ff31564842fa52c0d76e27e65cd2a841

URL: https://github.com/llvm/llvm-project/commit/5b4acb20ff31564842fa52c0d76e27e65cd2a841
DIFF: https://github.com/llvm/llvm-project/commit/5b4acb20ff31564842fa52c0d76e27e65cd2a841.diff

LOG: [OpenMP][FIX] Ensure flag to disable de-globalization works properly

If the user disables de-globalization we did not seed the AAHeapToShared
and AAHeapToStack but we still could end up with them through in-flight
lookups. With this patch we disable AAHeapToShared completely if the
user disabled de-globalization. Heap-2-stack is still run though.

Differential Revision: https://reviews.llvm.org/D121059

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/IPO/OpenMPOpt.cpp b/llvm/lib/Transforms/IPO/OpenMPOpt.cpp
index f3914f36fdfce..d49bf6c1bf57f 100644
--- a/llvm/lib/Transforms/IPO/OpenMPOpt.cpp
+++ b/llvm/lib/Transforms/IPO/OpenMPOpt.cpp
@@ -2963,6 +2963,11 @@ struct AAHeapToSharedFunction : public AAHeapToShared {
   }
 
   void initialize(Attributor &A) override {
+    if (DisableOpenMPOptDeglobalization) {
+      indicatePessimisticFixpoint();
+      return;
+    }
+
     auto &OMPInfoCache = static_cast<OMPInformationCache &>(A.getInfoCache());
     auto &RFI = OMPInfoCache.RFIs[OMPRTL___kmpc_alloc_shared];
 


        


More information about the llvm-commits mailing list