14 Commits

Author SHA1 Message Date
Hideto Ueno
dc77158b65 [Attributor] Deduce "nonnull" attribute
Summary:
Porting nonnull attribute to attributor.

Reviewers: jdoerfert, sstefan1

Reviewed By: jdoerfert

Subscribers: xbolva00, hiraditya, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366043 91177308-0d34-0410-b5e6-96231b3b80d8
2019-07-15 06:49:04 +00:00
Johannes Doerfert
76a1ea9a3c [Attributor][NFC] Run clang-format on the attributor files (.h/.cpp)
The Attributor files are kept formatted with clang-format, we should try
to keep this state.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365984 91177308-0d34-0410-b5e6-96231b3b80d8
2019-07-13 01:09:27 +00:00
Johannes Doerfert
3c9c8191b0 [Attributor] Only return attributes with a valid state
Attributor::getAAFor will now only return AbstractAttributes with a
valid AbstractState. This simplifies call sites as they only need to
check if the returned pointer is non-null. It also reduces the potential
for accidental misuse.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365983 91177308-0d34-0410-b5e6-96231b3b80d8
2019-07-13 01:09:21 +00:00
Stefan Stipanovic
2095d67864 Addition to rL365925, removing remaining virtuals
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365938 91177308-0d34-0410-b5e6-96231b3b80d8
2019-07-12 18:34:06 +00:00
Stefan Stipanovic
ba46a29ea7 [Attributor] Removing unnecessary virtual keywords.
Some function in the Attributor framework are unnecessarily
marked virtual. This patch removes virtual keyword

Reviewers: jdoerfert

Subscribers: hiraditya, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365925 91177308-0d34-0410-b5e6-96231b3b80d8
2019-07-12 17:42:14 +00:00
Hideto Ueno
703c80f8d1 [Attributor] Deduce "nofree" function attribute
Summary: Deduce "nofree" function attribute. A more concise description of "nofree" is on D49165.

Reviewers: jdoerfert

Reviewed By: jdoerfert

Subscribers: homerdin, hfinkel, lebedev.ri, hiraditya, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365924 91177308-0d34-0410-b5e6-96231b3b80d8
2019-07-12 17:38:51 +00:00
Stefan Stipanovic
52d4c048b3 [Attributor] Deduce "nosync" function attribute.
Introduce and deduce "nosync" function attribute to indicate that a function
does not synchronize with another thread in a way that other thread might free memory.

Reviewers: jdoerfert, jfb, nhaehnle, arsenm

Subscribers: wdng, hfinkel, nhaenhle, mehdi_amini, steven_wu,
dexonsmith, arsenm, uenoku, hiraditya, jfb, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365830 91177308-0d34-0410-b5e6-96231b3b80d8
2019-07-11 21:37:40 +00:00
Johannes Doerfert
dab869542b [Attributor] Deduce the "returned" argument attribute
Deduce the "returned" argument attribute by collecting all potentially
returned values.

Not only the unique return value, if any, can be used by subsequent
attributes but also the set of all potentially returned values as well
as the mapping from returned values to return instructions that they
originate from (see AAReturnedValues::checkForallReturnedValues).

Change in statistics (-stats) for LLVM-TS + Spec2006, totaling ~19% more "returned" arguments.

  ADDED: attributor                   NumAttributesManifested                  n/a ->        637
  ADDED: attributor                   NumAttributesValidFixpoint               n/a ->      25545
  ADDED: attributor                   NumFnArgumentReturned                    n/a ->        637
  ADDED: attributor                   NumFnKnownReturns                        n/a ->      25545
  ADDED: attributor                   NumFnUniqueReturned                      n/a ->      14118
CHANGED: deadargelim                  NumRetValsEliminated                     470 ->        449 (    -4.468%)
REMOVED: functionattrs                NumReturned                              535 ->        n/a
CHANGED: indvars                      NumElimIdentity                          138 ->        164 (   +18.841%)

Reviewers: homerdin, hfinkel, fedor.sergeev, sanjoy, spatel, nlopes, nicholas, reames, efriedma, chandlerc

Subscribers: hiraditya, bollu, cfe-commits, llvm-commits

Tags: #clang, #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365407 91177308-0d34-0410-b5e6-96231b3b80d8
2019-07-08 23:27:20 +00:00
Stefan Stipanovic
ffa5500e3a [Attributor] Deducing existing nounwind attribute.
Adding nounwind deduction in new attributor framework.

Reviewers: jdoerfert, uenoku

Subscribers: hiraditya, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@364521 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-27 11:27:54 +00:00
Johannes Doerfert
b8b2e16c53 [Attributor] Disable the Attributor by default and fix a comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@363408 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-14 14:53:41 +00:00
Stefan Stipanovic
226232fec0 test-commit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@362802 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-07 14:18:02 +00:00
Simon Pilgrim
7e97c400ef [IPO] Disabled 'default only' switch statements to fix MSVC warnings.
@jdoerfert Looks like these are placeholders for incoming abstract attributes patches so I've just commented the code out, even though this is usually frowned upon.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@362592 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-05 10:04:05 +00:00
Michael Liao
5d5e129235 Suppress false-positive GCC -Wreturn-type warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@362582 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-05 04:18:12 +00:00
Johannes Doerfert
f64487e26f [Attributor] Pass infrastructure and fixpoint framework
NOTE: Note that no attributes are derived yet. This patch will not go in
      alone but only with others that derive attributes. The framework is
      split for review purposes.

This commit introduces the Attributor pass infrastructure and fixpoint
iteration framework. Further patches will introduce abstract attributes
into this framework.

In a nutshell, the Attributor will update instances of abstract
arguments until a fixpoint, or a "timeout", is reached. Communication
between the Attributor and the abstract attributes that are derived is
restricted to the AbstractState and AbstractAttribute interfaces.

Please see the file comment in Attributor.h for detailed information
including design decisions and typical use case. Also consider the class
documentation for Attributor, AbstractState, and AbstractAttribute.

Reviewers: chandlerc, homerdin, hfinkel, fedor.sergeev, sanjoy, spatel, nlopes, nicholas, reames

Subscribers: mehdi_amini, mgorny, hiraditya, bollu, steven_wu, dexonsmith, dang, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@362578 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-05 03:02:24 +00:00