[Attributor] Introduce helpers to judge AAs prior to creation
authorJohannes Doerfert <johannes@jdoerfert.de>
Fri, 23 Jun 2023 21:32:31 +0000 (14:32 -0700)
committerJohannes Doerfert <johannes@jdoerfert.de>
Thu, 29 Jun 2023 19:32:45 +0000 (12:32 -0700)
commitd33bca840a824f59296230e83181012a0b1ba7ec
tree0bff98ebfb3ba9ef5e8423b2cca7af4ae52bf3b7
parentb9b0ab32f9d0a40ee225b2dc71bdf2f66b7127e8
[Attributor] Introduce helpers to judge AAs prior to creation

This is a partial cleanup to centralize the initialization and update
decisions for AAs. Lifting the burdon and boilerplate on users and
making it harder to accidentally perform unsound deductions.

The two static helpers show how we can lift the decisions to generate an
AA into the Attributor, avoiding trivial AAs that just cost us compile
time and maintenance code (to check for pre-conditions).
23 files changed:
llvm/include/llvm/Transforms/IPO/Attributor.h
llvm/lib/Target/AMDGPU/AMDGPUAttributor.cpp
llvm/lib/Transforms/IPO/OpenMPOpt.cpp
llvm/test/CodeGen/AMDGPU/uniform-work-group-multistep.ll
llvm/test/CodeGen/AMDGPU/uniform-work-group-propagate-attribute.ll
llvm/test/Transforms/Attributor/IPConstantProp/openmp_parallel_for.ll
llvm/test/Transforms/Attributor/IPConstantProp/pthreads.ll
llvm/test/Transforms/Attributor/IPConstantProp/thread_local_acs.ll
llvm/test/Transforms/Attributor/callbacks.ll
llvm/test/Transforms/Attributor/chain.ll
llvm/test/Transforms/Attributor/liveness.ll
llvm/test/Transforms/Attributor/nonnull.ll
llvm/test/Transforms/Attributor/openmp_parallel.ll
llvm/test/Transforms/Attributor/reduced/aa_execution_domain_wrong_fn.ll
llvm/test/Transforms/Attributor/reduced/openmp_opt_constant_type_crash.ll
llvm/test/Transforms/Attributor/returned.ll
llvm/test/Transforms/OpenMP/attributor_recursion_crash.ll
llvm/test/Transforms/OpenMP/custom_state_machines.ll
llvm/test/Transforms/OpenMP/custom_state_machines_pre_lto.ll
llvm/test/Transforms/OpenMP/deduplication_target.ll
llvm/test/Transforms/OpenMP/spmdization.ll
llvm/test/Transforms/OpenMP/spmdization_guarding_two_reaching_kernels.ll
llvm/test/Transforms/OpenMP/spmdization_no_guarding_two_reaching_kernels.ll