[PATCH] D114802: [OpenMP] Add RTL function to externalization RAII

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


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

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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D114802

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
@@ -1885,6 +1885,7 @@
                                        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);
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D114802.390712.patch
Type: text/x-patch
Size: 542 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211130/b31862fc/attachment.bin>


More information about the llvm-commits mailing list