29 Commits

Author SHA1 Message Date
Craig Topper
fe02c270b5 [CFLGraph] Add support for unary fneg instruction.
Differential Revision: https://reviews.llvm.org/D62791

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@362737 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-06 19:21:23 +00:00
George Burgess IV
883c3747ef CFLAA: reflow comments; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@362442 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-03 19:56:22 +00:00
Craig Topper
16d509d341 [CFLGraph] Add FAdd to visitConstantExpr.
This looks like an oversight as all the other binary operators are present.

Accidentally noticed while auditing places that need FNeg handling.

No test because as noted in the review it would be contrived and amount to "don't crash"

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@362441 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-03 19:35:52 +00:00
Chandler Carruth
65f398e467 Move CFLGraph and the AA summary code over to the new CallBase
instruction base class rather than the `CallSite` wrapper.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353676 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-11 09:25:41 +00:00
Chandler Carruth
6b547686c5 Update the file headers across all of the LLVM projects in the monorepo
to reflect the new license.

We understand that people may be surprised that we're moving the header
entirely to discuss the new license. We checked this carefully with the
Foundation's lawyer and we believe this is the correct approach.

Essentially, all code in the project is now made available by the LLVM
project under our new license, so you will see that the license headers
include that license only. Some of our contributors have contributed
code under our old license, and accordingly, we have retained a copy of
our old license notice in the top-level files in each project and
repository.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@351636 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-19 08:50:56 +00:00
Chandler Carruth
9179aee2c1 [IR] Replace isa<TerminatorInst> with isTerminator().
This is a bit awkward in a handful of places where we didn't even have
an instruction and now we have to see if we can build one. But on the
whole, this seems like a win and at worst a reasonable cost for removing
`TerminatorInst`.

All of this is part of the removal of `TerminatorInst` from the
`Instruction` type hierarchy.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340701 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-26 09:51:22 +00:00
George Burgess IV
758389d0d9 [CFLAA] Reflow comments; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@333330 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-26 02:17:43 +00:00
George Burgess IV
55033b07cb Revert r332657: "[AA] cfl-anders-aa with field sensitivity"
I don't believe the person who LGTMed this review has appropriate
context on this code. I apologize if I'm wrong.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332674 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-17 21:56:39 +00:00
David Bolvansky
39bca8321b [AA] cfl-anders-aa with field sensitivity
Summary:
There was some unfinished work started for offset tracking in CFLGraph by the author of implementation of Andersen algorithm. This work was completed and support for field sensitivity was added to the core of Andersen algorithm.

The performance results seem promising.

SPEC2006 int_base score was increased by 1.1 % (I  compared clang 6.0 with clang 6.0 with this patch). The avergae compile time was increased by +- 1 % according my measures with small and medium C/C++ projects (I did not tested it on the large projects with milions of lines of code)

Reviewers: chandlerc, george.burgess.iv, rja

Reviewed By: rja

Subscribers: rja, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332657 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-17 20:23:33 +00:00
David Bolvansky
74080eb944 [CFLGraph] Fixed Select instruction handling
Summary:
Operand 0 is the condition, not the true value.

Use op 1 and op 2 as the correct values.

Reviewers: george.burgess.iv, nlopes, efriedma

Reviewed By: george.burgess.iv

Subscribers: craig.topper, rjmccall, lebedev.ri, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331976 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-10 11:47:36 +00:00
David Bolvansky
090f8159a4 [CFLGraph][NFC] Simplify/reorder switch in visitConstantExpr
Reviewers: hfinkel, efriedma, spatel, dsanders, Danil, rjmccall

Reviewed By: rjmccall

Subscribers: dberlin, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331312 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-01 21:35:32 +00:00
Adrian Prantl
26b584c691 Remove \brief commands from doxygen comments.
We've been running doxygen with the autobrief option for a couple of
years now. This makes the \brief markers into our comments
redundant. Since they are a visual distraction and we don't want to
encourage more \brief markers in new code either, this patch removes
them all.

Patch produced by

  for i in $(git grep -l '\\brief'); do perl -pi -e 's/\\brief //g' $i & done

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331272 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-01 15:54:18 +00:00
Eugene Zelenko
c5e4ac86db [Analysis] Fix some Clang-tidy modernize-use-using and Include What You Use warnings; other minor fixes (NFC).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310766 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-11 21:30:02 +00:00
Davide Italiano
d1638eb7be [CFLAA] Remove unused include. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304842 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-06 23:16:19 +00:00
George Burgess IV
4e7dec8978 [CFLAA] Add missing break; note things are broken.
Thanks to Galina Kistanova for finding the missing break!

When trying to make a test for this, I realized our logic for handling
extractvalue/insertvalue/... is somewhat broken. This makes constructing
a test-case for this missing break nontrivial.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304275 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-31 02:35:26 +00:00
Reid Kleckner
a82b376f69 [IR] Abstract away ArgNo+1 attribute indexing as much as possible
Summary:
Do three things to help with that:
- Add AttributeList::FirstArgIndex, which is an enumerator currently set
  to 1. It allows us to change the indexing scheme with fewer changes.
- Add addParamAttr/removeParamAttr. This just shortens addAttribute call
  sites that would otherwise need to spell out FirstArgIndex.
- Remove some attribute-specific getters and setters from Function that
  take attribute list indices.  Most of these were only used from
  BuildLibCalls, and doesNotAlias was only used to test or set if the
  return value is malloc-like.

I'm happy to split the patch, but I think they are probably easier to
review when taken together.

This patch should be NFC, but it sets the stage to change the indexing
scheme to this, which is more convenient when indexing into an array:
  0: func attrs
  1: retattrs
  2...: arg attrs

Reviewers: chandlerc, pete, javed.absar

Subscribers: david2050, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302060 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-03 18:17:31 +00:00
Reid Kleckner
331b9af31d Use Argument::hasAttribute and AttributeList::ReturnIndex more
This eliminates many extra 'Idx' induction variables in loops over
arguments in CodeGen/ and Target/. It also reduces the number of places
where we assume that ReturnIndex is 0 and that we should add one to
argument numbers to get the corresponding attribute list index.

NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301666 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-28 18:37:16 +00:00
Craig Topper
a8fe21d79a [MemoryBuiltins] Add isMallocOrCallocLikeFn so BasicAA can check for both at the same time
BasicAA wants to know if a function is either a malloc or calloc like function. Currently we have to check both separately. This means both calls check if its an intrinsic, query TLI, check the nobuiltin attribute, scan the AllocationFnData, etc.

This patch adds a isMallocOrCallocLikeFn so we can go through all of the checks once per call.

This also changes the one other location I saw that called both together.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300608 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-18 21:43:46 +00:00
George Burgess IV
450453a6c0 [CFLAA] Check for pointer types in more places.
This patch fixes an assertion that fires when we try to add non-pointer
Values to the CFLGraph. Centralizing the check for whether something
is/isn't a pointer type isn't completely trivial (and, in some cases,
would end up being entirely redundant), but it may be beneficial to do
so if this trips us up more in the future.

Patch by Jia Chen.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277096 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-29 01:23:45 +00:00
George Burgess IV
3dba903392 [CFLAA] Add more offset-sensitivity tracking.
This patch teaches FunctionInfo about offsets.

Like the last patch, this one doesn't introduce any visible
functionality change (the core algorithm knows nothing about offsets;
they're just plumbed through). Tests will come when we start acting
differently because of the offsets.

Patch by Jia Chen.

(N.B. I made a tiny change to Jia's patch to avoid warnings by GCC: I
put DenseMapInfo specializations in the `llvm` namespace. Only realized
that those appeared when compiling locally. :) )

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276486 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-22 22:30:48 +00:00
Reid Kleckner
12e1ff6f81 Use INT64_MAX instead of LLONG_MAX
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276419 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-22 14:11:58 +00:00
Reid Kleckner
09577f3859 Fix the clang-cl self-host with VS 2013 headers
std::numeric_limits<int64_t>::max() is not constexpr in VC 2013 headers,
and Clang complains that it isn't. MSVC 2013 itself is emitting a
dynamic initializer for this thing. Instead, use an enum.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276334 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-21 21:06:04 +00:00
George Burgess IV
7a905f9108 [CFLAA] Add offset tracking in CFLGraph.
(Also, refactor our constexpr handling to be less insane).

This patch lets us track field offsets in the CFL Graph, which is the
first step to making CFLAA field/offset sensitive. Woohoo! Note that
this patch shouldn't visibly change our behavior (since we make no use
of the offsets we're now tracking), so we can't quite add tests for this
yet.

Patch by Jia Chen.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276201 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-20 22:53:30 +00:00
George Burgess IV
723a3ff949 [CFLAA] Add an initial CFLAnders implementation.
This adds an incomplete anders-style implementation for CFLAA. It's
incomplete in that it's missing interprocedural analysis, attrs
handling, etc. and that it needs more tests. More tests and features
will be added in future commits.

Patch by Jia Chen.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275602 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-15 19:53:25 +00:00
George Burgess IV
581370e98f Attempt to make buildbots happy.
Woohoo, unused variable warnings in builds without asserts (as a result
of r275122).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275126 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-11 23:18:32 +00:00
George Burgess IV
9e937064ea [CFLAA] Simplify CFLGraphBuilder. NFC.
This patch simplifies the graph builder by encoding nodes as {Value,
Dereference Level} pairs. This lets us kill edge types, and allows us to
get rid of hacks in StratifiedSets (like addAttrsBelow/...). This
simplification also allows us to remove InstantiatedRelations and
InstantiatedAttrs.

Patch by Jia Chen.

Differential Revision: http://reviews.llvm.org/D22080


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275122 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-11 22:59:09 +00:00
George Burgess IV
654ec29586 [CFLAA] Move the graph builder out from CFLSteens. NFC.
Patch by Jia Chen.

Differential Revision: http://reviews.llvm.org/D22022


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274958 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-09 02:54:42 +00:00
George Burgess IV
cc48e0f82a [CFLAA] Split out more things from CFLSteens. NFC.
"More things" = StratifiedAttrs and various bits like interprocedural
summaries.

Patch by Jia Chen.

Differential Revision: http://reviews.llvm.org/D21964


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274592 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-06 00:47:21 +00:00
George Burgess IV
02af278314 [CFLAA] Split the CFL graph out from CFLSteens. NFC.
Patch by Jia Chen.

Differential Revision: http://reviews.llvm.org/D21963


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274591 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-06 00:36:12 +00:00