[OpenMP] Create custom state machines for generic target regions
authorJohannes Doerfert <johannes@jdoerfert.de>
Thu, 20 May 2021 05:37:29 +0000 (00:37 -0500)
committerJohannes Doerfert <johannes@jdoerfert.de>
Sat, 10 Jul 2021 22:57:08 +0000 (17:57 -0500)
commitd9659bf6a036545125a39648b4abe838080299ec
treee69f7cc8c56d00bcfe2b1cc84092d5f1d8246d69
parente2cfbfcc0c1f3a89ab79c5615f0789b6a9966dc5
[OpenMP] Create custom state machines for generic target regions

In the spirit of TRegions [0], this patch creates a custom state
machine for a generic target region based on the potentially called
parallel regions.

The code analysis is done interprocedurally via an abstract attribute
(AAKernelInfo). All outermost parallel regions are collected and we
check if there might be unknown outermost parallel regions for which
we need an indirect call. Other AAKernelInfo extensions are expected.

[0] https://link.springer.com/chapter/10.1007/978-3-030-28596-8_11

Differential Revision: https://reviews.llvm.org/D101977
llvm/lib/Transforms/IPO/Attributor.cpp
llvm/lib/Transforms/IPO/OpenMPOpt.cpp
llvm/test/Transforms/OpenMP/custom_state_machines.ll [new file with mode: 0644]
llvm/test/Transforms/OpenMP/custom_state_machines_remarks.ll [new file with mode: 0644]
llvm/test/Transforms/OpenMP/globalization_remarks.ll
llvm/test/Transforms/OpenMP/remove_globalization.ll
llvm/test/Transforms/OpenMP/replace_globalization.ll
llvm/test/Transforms/OpenMP/single_threaded_execution.ll
llvm/test/Transforms/PhaseOrdering/openmp-opt-module.ll