[Attributor] Create abstract attributes on-demand
authorJohannes Doerfert <jdoerfert@anl.gov>
Tue, 20 Aug 2019 06:15:50 +0000 (06:15 +0000)
committerJohannes Doerfert <jdoerfert@anl.gov>
Tue, 20 Aug 2019 06:15:50 +0000 (06:15 +0000)
commit12cbbab9d9366d37bb2c6f1057491d07c83aba59
tree29d67b7829e6153d26ec7e1cc9a2df3ea2fa92da
parent169af994bcd66ff967441b036500b29d2cbef6c9
[Attributor] Create abstract attributes on-demand

Before, we create the set of abstract attributes initially and then
dealt with the fact hat a lookup could fail, e.g., return a nullptr.
This patch will ensure we always return a valid object from a lookup,
allowing us not only to remove the nullptr checks but also to grow the
set of abstract attributes "in-flight" on-demand.

One can now start from those that have the best chance of improving
performance without the need to specify all they might depend on.

While this introduces some boilerplate, the usage of attributes is much
easier and cleaner now.

Reviewers: uenoku, sstefan1

Subscribers: hiraditya, bollu, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D66276

llvm-svn: 369331
llvm/include/llvm/Transforms/IPO/Attributor.h
llvm/lib/Transforms/IPO/Attributor.cpp
llvm/test/Transforms/FunctionAttrs/align.ll
llvm/test/Transforms/FunctionAttrs/arg_returned.ll
llvm/test/Transforms/FunctionAttrs/dereferenceable.ll
llvm/test/Transforms/FunctionAttrs/noalias_returned.ll
llvm/test/Transforms/FunctionAttrs/nonnull.ll
llvm/test/Transforms/FunctionAttrs/nosync.ll
llvm/test/Transforms/FunctionAttrs/read_write_returned_arguments_scc.ll