[llvm] 7986a5f - [OpenMP] Add RTL function to externalization RAII

Joseph Huber via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 30 07:19:20 PST 2021


Author: Joseph Huber
Date: 2021-11-30T10:19:06-05:00
New Revision: 7986a5f23ebbf7fc3c6d667610fd193288dba7ce

URL: https://github.com/llvm/llvm-project/commit/7986a5f23ebbf7fc3c6d667610fd193288dba7ce
DIFF: https://github.com/llvm/llvm-project/commit/7986a5f23ebbf7fc3c6d667610fd193288dba7ce.diff

LOG: [OpenMP] Add RTL function to externalization RAII

This patch adds the `__kmpc_get_warp_size` OpenMP RTL function to the
externalization RAII struct. This was getting optimized out and then
being replaced with an undefined value once added back in, causing bugs
for complex reductions.

Reviewed By: jdoerfert

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

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 f342c35fa283c..eb062eeff2270 100644
--- a/llvm/lib/Transforms/IPO/OpenMPOpt.cpp
+++ b/llvm/lib/Transforms/IPO/OpenMPOpt.cpp
@@ -1885,6 +1885,7 @@ struct OpenMPOpt {
                                        OMPRTL___kmpc_barrier_simple_generic);
     ExternalizationRAII ThreadId(OMPInfoCache,
                                  OMPRTL___kmpc_get_hardware_thread_id_in_block);
+    ExternalizationRAII WarpSize(OMPInfoCache, OMPRTL___kmpc_get_warp_size);
 
     registerAAs(IsModulePass);
 


        


More information about the llvm-commits mailing list