125 Commits

Author SHA1 Message Date
Benjamin Kramer
1d7df59e12 Hide implementation details in namespaces.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372113 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-17 12:56:29 +00:00
Johannes Doerfert
80781fec87 [Attributor][Fix] Initialize the cache prior to using it
Summary:
There were segfaults as we modified and iterated the instruction maps in
the cache at the same time. This was happening because we created new
instructions while we populated the cache. This fix changes the order
in which we perform these actions. First, the caches for the whole
module are created, then we start to create abstract attributes.

I don't have a unit test but the LLVM test suite exposes this problem.

Reviewers: uenoku, sstefan1

Subscribers: hiraditya, bollu, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372105 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-17 10:52:41 +00:00
Hideto Ueno
f6a402010b [Attributor] Use Alias Analysis in noalias callsite argument deduction
Summary: This patch adds a check of alias analysis in `noalias` callsite argument deduction.

Reviewers: jdoerfert, sstefan1

Reviewed By: jdoerfert

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372075 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-17 06:53:27 +00:00
Hideto Ueno
8a6eaada3c [Attributor] Create helper struct for handling analysis getters
Summary: This patch introduces a helper struct `AnalysisGetter` to put together analysis getters. In this patch, a getter for `AAResult` is also added for  `noalias`.

Reviewers: jdoerfert, sstefan1

Reviewed By: jdoerfert

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372072 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-17 05:45:18 +00:00
Stefan Stipanovic
e342d834af [Attributor] Heap-To-Stack Conversion
D53362 gives a prototype heap-to-stack conversion pass. With addition of new attributes in the attributor, this can now be revisted and improved. This will place it in the Attributor to make it easier to use new attributes (eg. nofree, nosync, willreturn, etc.) and other attributor features.

Reviewers: jdoerfert, uenoku, hfinkel, efriedma

Subscribers: lebedev.ri, xbolva00, hiraditya, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371942 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-15 21:47:41 +00:00
Johannes Doerfert
60c9595c32 [Attributor][Fix] Use right type to replace expressions
Summary: This should be obsolete once the functionality in D66967 is integrated.

Reviewers: uenoku, sstefan1

Subscribers: hiraditya, bollu, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371915 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-14 02:57:50 +00:00
Hideto Ueno
df18bf27eb [Attributor] Implement "noalias" callsite argument deduction
Summary: Now, `nocapture` is deduced in Attributor therefore, this patch introduces deduction for `noalias` callsite argument using `nocapture`.

Reviewers: jdoerfert, sstefan1

Reviewed By: jdoerfert

Subscribers: lebedev.ri, hiraditya, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371590 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-11 07:00:33 +00:00
Hideto Ueno
58dc7cdf01 [Attributor][Fix] Manifest nocapture only in CSArgument or Argument
Summary:
We can query to Attributor whether the value is captured in the scope or not on the following way:

```
    const auto & NoCapAA = A.getAAFor<AANoCapture>(*this, IRPosition::value(V));
```
And if V is CallSiteReturned then `getDeducedAttribute` will add `nocatpure` to the callsite returned value. It is not valid.
This patch checks the position is an argument or call site argument.

This is tested in D67286.

Reviewers: jdoerfert, sstefan1

Reviewed By: jdoerfert

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371589 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-11 06:52:11 +00:00
Hideto Ueno
4525109839 [Attributor] ValueSimplify Abstract Attribute
Summary:
This patch introduces initial `AAValueSimplify` which simplifies a value in a context.

example
- (for function returned) If all the return values are the same and constant, then we can replace callsite returned with the constant.
- If an internal function takes the same value(constant) as an argument in the callsite, then we can replace the argument with that constant.

Reviewers: jdoerfert, sstefan1

Reviewed By: jdoerfert

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371291 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-07 07:03:05 +00:00
Johannes Doerfert
250999543c [Attributor][Stats] Use the right statistics macro
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370976 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-04 20:34:57 +00:00
Johannes Doerfert
423d592be2 [Attributor][Fix] Make sure we do not delete live code
Summary: Liveness needs to mark edges, not blocks as dead.

Reviewers: sstefan1, uenoku

Subscribers: hiraditya, bollu, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370975 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-04 20:34:52 +00:00
Johannes Doerfert
861056e6d6 [Attributor][Fix] Ensure the attribute names are created properly
The names of the attributes were not always created properly which
caused problems with the yaml output.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370956 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-04 19:01:08 +00:00
Johannes Doerfert
9d508be12e [Attributor] Look at internal functions only on-demand
Summary:
Instead of building attributes for internal functions which we do not
update as long as we assume they are dead, we now do not create
attributes until we assume the internal function to be live. This
improves the number of required iterations, as well as the number of
required updates, in real code. On our tests, the results are mixed.

Reviewers: sstefan1, uenoku

Subscribers: hiraditya, bollu, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370924 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-04 16:35:20 +00:00
Johannes Doerfert
8896c0fa80 [Attributor] Use the white list for attributes consistently
Summary:
We create attributes on-demand so we need to check the white list
on-demand. This also unifies the location at which we create,
initialize, and eventually invalidate new abstract attributes.

The tests show mixed results, a few more call site attributes are
determined which can cause more iterations.

Reviewers: uenoku, sstefan1

Subscribers: hiraditya, bollu, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370922 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-04 16:26:20 +00:00
Johannes Doerfert
91ae0b70af [Attributor] Deal more explicit with non-exact definitions
Summary:
Before we tried to rule out non-exact definitions early but that lead to
on-demand attributes created for them anyway. As a consequence we needed
to look at the definition in the initialize of each attribute again.
This patch centralized this lookup and tightens the condition under
which we give up on non-exact definitions.

Reviewers: uenoku, sstefan1

Subscribers: hiraditya, bollu, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370917 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-04 16:16:13 +00:00
Johannes Doerfert
ab5d98def1 [Attributor] Use the delete API for liveness
Reviewers: uenoku, sstefan1

Subscribers: hiraditya, bollu, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370818 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-03 20:42:16 +00:00
Johannes Doerfert
a5d420688d [Attributor] Deduce "no-capture" argument attribute
Add the no-capture argument attribute deduction to the Attributor
fixpoint framework.

The new string attributed "no-capture-maybe-returned" is introduced to
allow deduction of no-capture through functions that "capture" an
argument but only by "returning" it. It is only used by the Attributor
for testing.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370817 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-03 20:37:24 +00:00
Johannes Doerfert
2e4a0dd32b [Attributor] Fix: do not pretend to preserve the CFG
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370485 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-30 16:35:10 +00:00
Johannes Doerfert
90d7e223b8 [Attributor] Use existing function information for the call site
Summary:
Instead of recomputing information for call sites we now use the
function information directly. This is always valid and once we have
call site specific information we can improve here.

This patch also bootstraps attributes that are created on-demand through
an initial update call. Information that is known will then directly be
available in the new attribute without causing an iteration delay.

The tests show how this improves the iteration count.

Reviewers: sstefan1, uenoku

Subscribers: hiraditya, bollu, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370480 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-30 15:24:52 +00:00
Johannes Doerfert
1d1af82429 [Attributor] Manifest load/store alignment generally
Summary:
Any pointer could have load/store users not only floating ones so we
move the manifest logic for alignment into the AAAlignImpl class.

Reviewers: uenoku, sstefan1

Subscribers: hiraditya, bollu, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370479 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-30 15:22:28 +00:00
Hideto Ueno
d4b0982cc0 [Attributor] Implement AANoAliasCallSiteArgument initialization
Summary: This patch adds an appropriate `initialize` method for `AANoAliasCallSiteArgument`.

Reviewers: jdoerfert, sstefan1

Reviewed By: jdoerfert

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370456 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-30 10:00:32 +00:00
Simon Pilgrim
688e45942a Fix variable set but no used warnings on NDEBUG builds. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370319 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-29 10:08:45 +00:00
Hideto Ueno
2c071ee73d [Attributor] Deduce "noalias" attribute
Summary:
This patch adds very basic deduction for noalias.

Reviewers: jdoerfert, sstefan1

Reviewed By: jdoerfert

Tags: LLVM

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370295 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-29 05:52:00 +00:00
Johannes Doerfert
632c7e8319 [Attributor] Improve messages in iteration verify mode
When we now verify the iteration count we will see the actual count
and the expected count before the assertion is triggered.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370285 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-29 01:29:44 +00:00
Johannes Doerfert
c1b56af013 [Attributor][Fix] Indicate change correctly
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370283 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-29 01:26:58 +00:00
Johannes Doerfert
f82eedb6b6 [Attributor] Fix typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370282 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-29 01:26:09 +00:00
Johannes Doerfert
08d064c8f1 [Attributor] Regularly clear dependences to remove spurious ones
As dependences between abstract attributes can become stale, e.g., if
one was sufficient to imply another one at some point but it has since
been wakened to the point it is not usable for the formerly implied one.
To weed out spurious dependences, and thereby eliminate unneeded
updates, we introduce an option to determine how often the dependence
cache is cleared and recomputed during the fixpoint iteration.

Note that the initial value was determined such that we see a positive
result on our tests.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370230 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-28 16:58:52 +00:00
Johannes Doerfert
5b06dbd081 [Attributor] Restrict liveness and return information to functions
Summary:
Until we have proper call-site information we should not recompute
liveness and return information for each call site. This patch directly
uses the function versions and introduces TODOs at the usage sites.

The required iterations to get to the fixpoint are most of the time
reduced by this change and we always avoid work duplication.

Reviewers: sstefan1, uenoku

Subscribers: hiraditya, bollu, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370208 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-28 14:09:14 +00:00
Johannes Doerfert
cf063dd2c8 [Attributor] Introduce an API to delete stuff
Summary:
During the fixpoint iteration, including the manifest stage, we should
not delete stuff as other abstract attributes might have a reference to
the value. Through the API this can now be done safely at the very end.

Reviewers: uenoku, sstefan1

Subscribers: hiraditya, bollu, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370014 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-27 04:57:54 +00:00
Johannes Doerfert
2faccd30cf [Attributor] Adjust and test the iteration bound of tests
Summary:
Try to verify how many iterations we need for a fixpoint in our tests.
This patch adjust the way we count to make it easier to follow. It also
adjusts the bounds to actually account for a fixpoint and not only the
minimum number to pass all checks.

Reviewers: uenoku, sstefan1

Subscribers: hiraditya, bollu, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369945 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-26 18:55:47 +00:00
Johannes Doerfert
077bfee769 [Attributor] Further cut down on non-determinism
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369936 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-26 17:51:23 +00:00
Johannes Doerfert
bfea5700a7 [Attributor] Allow explicit dependence tracking
By default, the Attributor tracks potential dependences between abstract
attributes based on the issued Attributor::getAAFor queries. This
simplifies the development of new abstract attributes but it can also
lead to spurious dependences that might increase compile time and make
internalization harder (D63312). With this patch, abstract attributes
can opt-out of implicit dependence tracking and instead register
dependences explicitly. It is up to the implementation to make sure all
existing dependences are registered.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369935 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-26 17:48:05 +00:00
Johannes Doerfert
788923e708 [Attributor] Manifest alignment in load and store instructions
Summary:
We can now manifest alignment information in load/store instructions if
the pointer is known to have a better alignment.

Reviewers: uenoku, sstefan1, lebedev.ri

Subscribers: hiraditya, bollu, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369804 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-23 20:20:10 +00:00
Johannes Doerfert
98e18d4f0f [Attributor] Manifest constant return values
Summary:
If the unique return value is a constant we now replace call uses with
that constant.

Reviewers: sstefan1, uenoku

Subscribers: hiraditya, bollu, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369785 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-23 17:41:37 +00:00
Johannes Doerfert
a8af4b8fe0 [Attributor] Deal with shrinking dereferenceability in a loop
Summary:
If we have a loop in which the dereferenceability of a pointer decreases
we did slowly decrease it iteration by iteration, leading to a timeout.
With this patch we detect such circular reasoning and indicate a
fixpoint early.

Reviewers: uenoku, sstefan1

Subscribers: hiraditya, bollu, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369784 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-23 17:29:23 +00:00
Johannes Doerfert
44404116d0 [Attributor][Fix] Deal with "growing" dereferenceability
Summary:
If we have a negative inbounds offset dereferenceabily "grows". However,
until we do not handle the overflow that can occur in the
dereferenceable bytes and the problem with loops, we simply do not grow
the state.

Reviewers: sstefan1, uenoku

Subscribers: hiraditya, bollu, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369771 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-23 15:45:46 +00:00
Johannes Doerfert
82f6085fb6 [Attributor][NFCI] Avoid lookups when resolving returned values
If the number of potentially returned values not change since the last
traversal we do not need to visit the returned values again. This works
as we only add values to the returned values set now.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369770 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-23 15:42:19 +00:00
Johannes Doerfert
9d74846aa2 [Attributor] FIX: Treat new attributes as changed ones
Summary:
When we have new attributes and we end the fixpoint iteration because
the iteration limit is reached, we need to treat the new ones as if they
changed in the last iteration, as they might have.

This adds a test for which we should not derive anything regardless of
the iteration limit, e.g., if we abort there should not be any
attributes manifested in the IR.

Reviewers: uenoku, sstefan1

Subscribers: hiraditya, bollu, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369768 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-23 15:24:57 +00:00
Johannes Doerfert
2274be45f6 [Attributor][NFCI] Try to avoid potential non-deterministic behavior
This commit replaces sets with set vectors in an effort to make the
behavior of the Attributor deterministic.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369767 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-23 15:23:49 +00:00
Hideto Ueno
58ad398198 [Attributor][NFC] Move DerefState to header and use StateWrapper
Summary: In D65402, I want to get DerefState from AADereferenceable but it was not allowed. This patch moves DerefState definition into Attributor.h and makes AADerefenceable inherit StateWrapper.

Reviewers: jdoerfert, sstefan1

Reviewed By: jdoerfert

Subscribers: hiraditya, jfb, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369653 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-22 14:18:29 +00:00
Johannes Doerfert
62899a2174 [Attributor] Fix: Gracefully handle non-instruction users
Function can have users that are not instructions, e.g., bitcasts. For
now, we simply give up when we see them.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369588 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-21 21:48:56 +00:00
Johannes Doerfert
1ddd66ae99 [Attributor][NFC] Fix copy & paste error
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369577 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-21 20:57:20 +00:00
Johannes Doerfert
c7e023f5b1 [Attributor][NFC] Remove leftover semicolon
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369576 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-21 20:56:56 +00:00
Johannes Doerfert
fb4d7290e9 [Attributor] Use existing unreachable instead of introducing new ones
So far we split the unreachable off and placed a new one, this is not
necessary.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369575 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-21 20:56:41 +00:00
Stefan Stipanovic
bd81b97a72 [Attributor] Liveness for internal functions.
For an internal function, if all its call sites are dead, the body of the function is considered dead.

Reviewers: jdoerfert, uenoku

Subscribers: hiraditya, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369470 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-20 23:16:57 +00:00
Michael Liao
823c789913 [Attributor] Remove unused variable. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369444 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-20 21:02:31 +00:00
Fangrui Song
feb866a4ee [Attributor] Fix -Wunused-variable in -DLLVM_ENABLE_ASSERTIONS=off builds after r369331
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369334 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-20 07:21:43 +00:00
Johannes Doerfert
d10ede945e [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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369331 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-20 06:15:50 +00:00
Johannes Doerfert
08efae3b0a [Attributor][NFC] Cleanup statistics code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369330 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-20 06:09:56 +00:00
Johannes Doerfert
2cf3cb29ab [Attributor] Use structured deduction for AADereferenceable
Summary:
This is analogous to D66128 but for AADereferenceable. We have the logic
concentrated in the floating value updateImpl and we use the combiner
helper classes for arguments and return values.

The regressions will go away with "on-demand" attribute creation.
Improvements are already visible in the existing tests.

Reviewers: uenoku, sstefan1

Subscribers: hiraditya, bollu, jfb, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369329 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-20 06:08:35 +00:00