[OpenMP] Avoid running openmp-opt on dead functions
authorJohannes Doerfert <johannes@jdoerfert.de>
Tue, 10 Jan 2023 21:51:28 +0000 (13:51 -0800)
committerJohannes Doerfert <johannes@jdoerfert.de>
Tue, 10 Jan 2023 23:03:51 +0000 (15:03 -0800)
commitb2a8d2c69bce98604f1feaad9e6bebd3759b5635
treeaa608d095cd8f921c227b1f457bf2cdc8006c2f2
parentc3de9c1c7b93683ab9d390cb2d830204bfa657bc
[OpenMP] Avoid running openmp-opt on dead functions

The Attributor has logic to run only on assumed live functions and this
is exposed to users now. OpenMP-opt will (mostly) ignore dead internal
functions now but run the same deduction as before if an internal
function is marked live.

This should lower compile time as we run on less code and delete more
code early on. For the full OpenMC module compiled with noinline and
JITed at runtime, we save ~25%, or ~10s on my machine during JITing.
llvm/include/llvm/Transforms/IPO/Attributor.h
llvm/lib/Transforms/IPO/OpenMPOpt.cpp
llvm/test/Transforms/Attributor/reduced/openmp_opt_dont_follow_gep_without_value.ll
llvm/test/Transforms/OpenMP/global_constructor.ll
llvm/test/Transforms/OpenMP/reduced_pointer_info_assertion.ll
llvm/test/Transforms/OpenMP/single_threaded_execution.ll