[OpenMP] Replace ExternalizationRAII with virtual uses
authorJohannes Doerfert <johannes@jdoerfert.de>
Wed, 11 Jan 2023 09:22:45 +0000 (01:22 -0800)
committerJohannes Doerfert <johannes@jdoerfert.de>
Thu, 12 Jan 2023 08:14:06 +0000 (00:14 -0800)
commitcefa5cefdce2d5090002c3116403f7e5ca5700b9
tree6b4b658318e76efdb5f8b3866a1f57e48363fd0b
parent2d9f44512e5cf288c945123293b3408a91dee7c0
[OpenMP] Replace ExternalizationRAII with virtual uses

The externalization was always a stopgap solution. One of the drawbacks
is that it is very conservative no matter if we actually require the
functions at the end of the pass. The new concept is more generic and
properly integrates into the dependence graph. Whenever we might need a
function, it has a "virtual use" that cannot be analyzed. If we do not
because of some AA state, there will be a dependence to ensure state
changes trigger revisits of uses, including a potentially new virtual
use.
llvm/include/llvm/Transforms/IPO/Attributor.h
llvm/lib/Transforms/IPO/Attributor.cpp
llvm/lib/Transforms/IPO/OpenMPOpt.cpp
llvm/test/Transforms/OpenMP/get_hardware_num_threads_in_block_fold.ll