Commit Graph

92 Commits

Author SHA1 Message Date
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
Johannes Doerfert e931b74a9d [Attributor] Use structured deduction for AANonNull
Summary:
What D66126 did for AAAlign, this patch does for AANonNull. Agian, the
logic becomes more concise and localized. Again, returned poiners are
not annotated properly but that will not be an issue if this lands with
the "on-demand" generation of attributes. First improvements due to the
genericValueTraversal are already visible.

Reviewers: sstefan1, uenoku

Subscribers: hiraditya, bollu, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369328 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-20 06:02:39 +00:00
Johannes Doerfert 365fcdb0fa [Attributor] Fix the "clamp" operator
The clamp operator should not take the known of the given state as the
known is potentially based on assumed information. This also adds TODOs
to guide improvements.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369327 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-20 05:57:01 +00:00
Johannes Doerfert 9e64010f49 Recommit "[Attributor] Fix: Do not partially resolve returned calls."
This reverts commit b1752f670f3d6393306dd5d37546b6e23384d8a2.

Fixed the issue with a different commit, reapply this one as it was,
afaik, not broken.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369303 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-19 21:35:31 +00:00
Johannes Doerfert cda1c6dac6 Re-apply fixed "[Attributor] Fix: Make sure we set the changed flag"
This reverts commit cedd0d9a6e4b433e1cd6585d1d4d152eb5e60b11.

Re-apply the original commit but make sure the variables are initialized
(even if they are not used) so UBSan is not complaining.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369294 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-19 19:14:10 +00:00
David L. Jones b694b48636 Revert [Attributor] Fix: Make sure we set the changed flag
This reverts r369159 (git commit cbaf1fdea2de891bdbc49cdec89ae2077e6b9ed0)

r369160 caused a test to fail under UBSAN. See thread on llvm-commits.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369241 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-19 08:00:08 +00:00
David L. Jones d62675ff05 Revert [Attributor] Fix: Do not partially resolve returned calls.
This reverts r369160 (git commit f72d9b1c97b41fff48ad1eecbba59a29c171bff4)

r369160 caused some tests to fail under UBSAN. See thread on llvm-commits.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369236 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-19 07:16:24 +00:00
Johannes Doerfert 63772f962d [Attributor] Fix: Do not partially resolve returned calls.
By partially resolving returned calls we did not record that they were
not fully resolved which caused odd behavior down the line. We could
also end up with some, but not all, returned values of the callee in the
returned values map of the caller, another odd behavior we want to
avoid.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369160 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-16 21:59:52 +00:00
Johannes Doerfert 0967d695fa [Attributor] Fix: Make sure we set the changed flag
The flag was updated *before* we actually run the visitor callback so we
might miss updates.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369159 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-16 21:55:01 +00:00
Johannes Doerfert 7490cd5d25 [Attributor] Add all missing attribute definitions/symbols
As a preparation to "on-demand" abstract attribute generation we need
implementations for all attributes (as they can be queried and then
created on-demand where we now fail to find one).

Reviewers: uenoku, sstefan1

Subscribers: hiraditya, bollu, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369155 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-16 21:31:11 +00:00
Johannes Doerfert 1b82a898f6 [Attributor] Towards a more structured deduction pattern
Summary:
This is the first commit aiming to structure the attribute deduction.
The base idea is that we have default propagation patterns as listed
below on top of which we can add specific, e.g., context sensitive,
logic.

Deduction patterns used in this patch:
  - argument states are determined from call site argument states,
    see AAAlignArgument and AAArgumentFromCallSiteArguments.
  - call site argument states are determined as if they were floating
    values, see AAAlignCallSiteArgument and AAAlignFloating.
  - floating value states are determined by traversing the def-use chain
    and combining the states determined for the leaves, see
    AAAlignFloating and genericValueTraversal.
  - call site return states are determined from function return states,
    see AAAlignCallSiteReturned and AACallSiteReturnedFromReturned.
  - function return states are determined from returned value states,
    see AAAlignReturned and AAReturnedFromReturnedValues.

Through this strategy all logic for alignment is concentrated in the
AAAlignFloating::updateImpl method.

Note: This commit works on its own but is part of a larger change that
involves "on-demand" creation of abstract attributes that will
participate in the fixpoint iteration. Without this part, we sometimes
do not have an AAAlign abstract attribute to query, loosing information
we determined before. All tests have appropriate FIXMEs and the
information will be recovered once we added all parts.

Reviewers: sstefan1, uenoku

Subscribers: hiraditya, bollu, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369144 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-16 19:51:23 +00:00
Johannes Doerfert 910dc4b685 [Attributor][NFC] Introduce aliases for call site attributes
Until we have call site specific liveness and/or value information there
is no need to do call site specific deduction. Though, we need the
symbols in follow up patches that make Attributor::getAAFor return a
reference.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369143 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-16 19:49:00 +00:00
Johannes Doerfert 0d91b9a332 [Attributor] Introduce initialize calls and move code to keep attributes concise
Summary:
This patch should not change the behavior except that the added
initialize methods might indicate an optimistic fixpoint earlier. The
code movement is done to keep the attribute definitions in a single
block where it makes sense. No functional changes intended there.

Reviewers: uenoku, sstefan1

Subscribers: hiraditya, bollu, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369142 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-16 19:36:17 +00:00
Johannes Doerfert fb661b795c [Attributor] Try to fix "missing field 'RetInsts' initializer" warning
http://lab.llvm.org:8011/builders/lld-x86_64-darwin13/builds/35674/steps/build_Lld/logs/stdio

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368938 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-14 22:32:29 +00:00
Johannes Doerfert 4c82bdcd6c [Attributor][NFC] Make debug output consistent
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368931 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-14 22:04:28 +00:00
Johannes Doerfert ee78bffd35 [Attributor][NFC] Try to eliminate warnings (debug build + fall through)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368928 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-14 21:46:28 +00:00
Johannes Doerfert 81b62a141b [Attributor][NFC] Introduce statistics macros for new positions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368927 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-14 21:46:25 +00:00
Johannes Doerfert ff6f91e527 [Attributor][NFC] Add merge/join/clamp operators to the IntegerState
Differential Revision: https://reviews.llvm.org/D66146

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368925 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-14 21:35:20 +00:00
Johannes Doerfert 8e521dae89 [Attributor] Use the AANoNull attribute directly in AADereferenceable
Summary:
Instead of constantly keeping track of the nonnull status with the
dereferenceable information we can simply query the nonnull attribute
whenever we need the information (debug + manifest).

Reviewers: sstefan1, uenoku

Subscribers: hiraditya, bollu, jfb, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368924 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-14 21:31:32 +00:00
Johannes Doerfert bbf596a730 [Attributor] Use liveness during the creation of AAReturnedValues
Summary:
As one of the first attributes, and one of the complex ones,
AAReturnedValues was not using liveness but we filtered the result after
the fact. This change adds liveness usage during the creation. The
algorithm is also improved and shorter.

The new algorithm will collect returned values over time using the
generic facilities that work with liveness already, e.g.,
genericValueTraversal which does not look at dead PHI node predecessors.
A test to show how this leads to better results is included.

Note: Unresolved calls and resolved calls are now tracked explicitly.

Reviewers: uenoku, sstefan1

Subscribers: hiraditya, bollu, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368922 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-14 21:29:37 +00:00
Johannes Doerfert c5595c0ce3 [Attributor] Do not update or manifest dead attributes
Summary:
If the associated context instruction is assumed dead we do not need to
update or manifest the state.

Reviewers: sstefan1, uenoku

Subscribers: hiraditya, bollu, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368921 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-14 21:25:08 +00:00
Johannes Doerfert f7888363df [Attributor] Use IRPosition consistently
Summary:
The next attempt to clean up the Attributor interface before we grow it
further.

Before, we used a combination of two values (associated + anchor) and an
argument number (or -1) to determine a location. This was very fragile.
The new system uses exclusively IR positions and we restrict the
generation of IR positions to special constructor methods that verify
internal constraints we have. This will catch misuse early.

The auto-conversion, e.g., in getAAFor, is now performed through the
SubsumingPositionIterator. This iterator takes an IR position and allows
to visit all IR positions that "subsume" the given one, e.g., function
attributes "subsume" argument attributes of that function. For a
detailed breakdown see the class comment of SubsumingPositionIterator.

This patch also introduces the IRPosition::getAttrs() to extract IR
attributes at a certain position. The method knows how to look up in
different positions that are equivalent, e.g., the argument position for
call site arguments. We also introduce three new positions kinds such
that we have all IR positions where attributes can be placed and one for
"floating" values.

Reviewers: sstefan1, uenoku

Subscribers: hiraditya, bollu, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368919 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-14 21:18:01 +00:00
Johannes Doerfert 26392263c3 [Attributor] Use the cached data layout directly
This removes the warning by using the new DL member.
It also simplifies the code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368625 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-12 22:21:09 +00:00
Johannes Doerfert 34aa0a38a6 [Attributor][NFC] Add IntegerState raw_ostream << operator
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368622 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-12 22:07:34 +00:00
Johannes Doerfert cdc8a88e64 [Attributor] Make the InformationCache an Attributor member
The functionality is not changed but the interfaces are simplified and
repetition is removed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368621 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-12 22:05:53 +00:00
Johannes Doerfert 3a35c9a698 [Attributor][Stats] Locate statistics tracking with the attributes
Summary:
The ever growing switch required Attribute::AttrKind values but they
might not be available for all abstract attributes we deduce. With the
new method we track statistics at the abstract attribute level. The
provided macros simplify the usage and make the messages uniform.

Reviewers: sstefan1, uenoku

Subscribers: hiraditya, bollu, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368227 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-07 22:46:11 +00:00
Johannes Doerfert a0e1643897 [Attributor][NFC] Code simplification and style normalization
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368225 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-07 22:36:15 +00:00
Johannes Doerfert 4078102f4b [Attributor] Introduce a state wrapper class
Summary:
The wrapper reduces boilerplate code and also provide a nice way to
determine the state type used by an abstract attributes statically via
AAType::StateType.

This was already discussed as part of the review of D65711.

Reviewers: sstefan1, uenoku

Subscribers: hiraditya, bollu, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368224 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-07 22:34:26 +00:00
Johannes Doerfert e892d1f282 [Attributor][NFC] Avoid unnecessary liveness queries
If we know everything is live there is no need to query for liveness.
Indicating a pessimistic fixpoint will cause the state to be "invalid"
which will cause the Attributor to not return the AAIsDead on request,
which will prevent us from querying isAssumedDead().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368223 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-07 22:32:38 +00:00
Johannes Doerfert 30deba89f0 [Attributor] Provide easier checkForallReturnedValues functionality
Summary:
So far, whenever one wants to look at returned values, one had to deal
with the AAReturnedValues and potentially with the AAIsDead attribute.
In the same spirit as other checkForAllXXX methods, we add this
functionality now to the Attributor. By adopting the use sites we got
better results when return instructions were dead.

Reviewers: sstefan1, uenoku

Subscribers: hiraditya, bollu, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368222 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-07 22:27:24 +00:00
Stefan Stipanovic ac96e13552 [Attributor] Introduce checkForAllReadWriteInstructions(...).
Summary: Similarly to D65731 `Attributor::checkForAllReadWriteInstructions` is introduced.

Reviewers: jdoerfert, uenoku

Subscribers: hiraditya, jfb, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368194 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-07 18:26:02 +00:00
Kristina Brooks 3778feeff3 [Attributor][modulemap] Revert r368064 but fix the build
Commit r368064 was necessary after r367953 (D65712) broke the module
build. That happened, apparently, because the template class IRAttribute
defined in the header had a virtual method defined in the corresponding
source file (IRAttribute::manifest). To unbreak the situation this patch
introduces a helper function IRAttributeManifest::manifestAttrs which
is used to implement IRAttribute::manifest in the header. The deifnition
of the helper function is still in the source file.

Patch by jdoerfert (Johannes Doerfert)

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368076 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-06 19:53:19 +00:00
Johannes Doerfert 8b9dae0f9d [Attributor][NFC] Outline common pattern into helper method
This helper will also allow to also place logic to determine if an
abstract attribute is necessary in the first place.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@367966 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-06 00:55:11 +00:00
Johannes Doerfert 3e62aa52b0 [Attributor] Provide a generic interface to check live instructions
Summary:
Similar to `Attributor::checkForAllCallSites`, we now provide such
functionality for instructions of a certain opcode through
`Attributor::checkForAllInstructions` and the convenient wrapper
`Attributor::checkForAllCallLikeInstructions`. This cleans up code,
avoids duplication, and simplifies the usage of liveness information.

Reviewers: sstefan1, uenoku

Subscribers: hiraditya, bollu, llvm-commits

Tags: #llvm

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

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