1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 02:52:53 +02:00
Commit Graph

42 Commits

Author SHA1 Message Date
Nikita Popov
51f95f57fa [PostOrderIterator] Use SmallVector to store stack; NFC
We use a SmallPtrSet to track visited nodes, use a SmallVector
of the same size for the stack.
2020-03-29 14:29:02 +02:00
Chandler Carruth
ae65e281f3 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.

llvm-svn: 351636
2019-01-19 08:50:56 +00:00
Nicolai Haehnle
0888142443 [DA] DivergenceAnalysis for unstructured, reducible CFGs
Summary:
This is patch 2 of the new DivergenceAnalysis (https://reviews.llvm.org/D50433).

This patch contains a generic divergence analysis implementation for
unstructured, reducible Control-Flow Graphs. It contains two new classes.
The `SyncDependenceAnalysis` class lazily computes sync dependences, which
relate divergent branches to points of joining divergent control. The
`DivergenceAnalysis` class contains the generic divergence analysis
implementation.

Reviewers: nhaehnle

Reviewed By: nhaehnle

Subscribers: sameerds, kristina, nhaehnle, xbolva00, tschuett, mgorny, llvm-commits

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

llvm-svn: 344734
2018-10-18 09:38:44 +00:00
Chandler Carruth
eb66b33867 Sort the remaining #include lines in include/... and lib/....
I did this a long time ago with a janky python script, but now
clang-format has built-in support for this. I fed clang-format every
line with a #include and let it re-sort things according to the precise
LLVM rules for include ordering baked into clang-format these days.

I've reverted a number of files where the results of sorting includes
isn't healthy. Either places where we have legacy code relying on
particular include ordering (where possible, I'll fix these separately)
or where we have particular formatting around #include lines that
I didn't want to disturb in this patch.

This patch is *entirely* mechanical. If you get merge conflicts or
anything, just ignore the changes in this patch and run clang-format
over your #include lines in the files.

Sorry for any noise here, but it is important to keep these things
stable. I was seeing an increasing number of patches with irrelevant
re-ordering of #include lines because clang-format was used. This patch
at least isolates that churn, makes it easy to skip when resolving
conflicts, and gets us to a clean baseline (again).

llvm-svn: 304787
2017-06-06 11:49:48 +00:00
Eugene Zelenko
58646d492d [ADT] Fix some Clang-tidy modernize-use-using warnings; other minor fixes (NFC).
llvm-svn: 303221
2017-05-16 23:10:25 +00:00
Craig Topper
f85e0d3530 [GVN] Fix accidental double storage of the function BasicBlock list in iterateOnFunction
Summary:
iterateOnFunction creates a ReversePostOrderTraversal object which does a post order traversal in its constructor and stores the results in an internal vector. Iteration over it just reads from the internal vector in reverse order.

The GVN code seems to be unaware of this and iterates over ReversePostOrderTraversal object and makes a copy of the vector into a local vector. (I think at one point in time we used a DFS here instead which would have required the local vector).

The net affect of this is that we have two vectors containing the basic block list. As I didn't want to expose the implementation detail of ReversePostOrderTraversal's constructor to GVN, I've changed the code to do an explicit post order traversal storing into the local vector and then reverse iterate over that.

I've also removed the reserve(256) since the ReversePostOrderTraversal wasn't doing that. I can add it back if we thinks it important. Though it seemed weird that it wasn't based on the size of the function.

Reviewers: davide, anemet, dberlin

Subscribers: llvm-commits

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

llvm-svn: 298191
2017-03-18 18:24:41 +00:00
Eugene Zelenko
f6dfd4f698 Fix some Clang-tidy modernize-use-default and Include What You Use warnings; other minor fixes (NFC).
llvm-svn: 288285
2016-11-30 23:10:42 +00:00
Tim Shen
e69d467a94 [ADT] Change PostOrderIterator to use NodeRef. NFC.
Reviewers: dblaikie

Subscribers: mzolotukhin, llvm-commits

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

llvm-svn: 278752
2016-08-15 21:52:54 +00:00
Sean Silva
7c30828bb9 Fix stale name in comment.
llvm-svn: 272382
2016-06-10 08:48:49 +00:00
Michael Liao
7751a953c3 Remove unnecessary argument in ipo iterator
- Otherwise, it won't be compiled if that template is instantiated.

llvm-svn: 250153
2015-10-13 07:26:04 +00:00
Alexander Kornienko
f993659b8f Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC)
Apparently, the style needs to be agreed upon first.

llvm-svn: 240390
2015-06-23 09:49:53 +00:00
Alexander Kornienko
40cb19d802 Fixed/added namespace ending comments using clang-tidy. NFC
The patch is generated using this command:

tools/clang/tools/extra/clang-tidy/tool/run-clang-tidy.py -fix \
  -checks=-*,llvm-namespace-comment -header-filter='llvm/.*|clang/.*' \
  llvm/lib/


Thanks to Eugene Kosov for the original patch!

llvm-svn: 240137
2015-06-19 15:57:42 +00:00
Daniel Berlin
0b8b18403a Update for post-commit review comments
llvm-svn: 235038
2015-04-15 19:36:10 +00:00
Daniel Berlin
8880b4b1c6 Add range iterators for post order and inverse post order. Use them
llvm-svn: 235026
2015-04-15 17:41:42 +00:00
David Majnemer
ade8f38a4d PostOrderIterator: Remove stray semicolon
llvm-svn: 232316
2015-03-15 07:09:18 +00:00
David Blaikie
60a1bdcf4c Remove reserved identifier & some unnecessary 'inline'
llvm-svn: 232308
2015-03-15 03:11:24 +00:00
Michael Ilseman
459da39308 Update template specialization to reflect API changes.
po_iterator_storage's insertEdge was updated to reflect the API
changes from many of our insert methods in r222334, however the
template specialization for external storage was not updated. This
updates the specialization.

llvm-svn: 222446
2014-11-20 19:33:30 +00:00
David Blaikie
60e6c80905 Update SetVector to rely on the underlying set's insert to return a pair<iterator, bool>
This is to be consistent with StringSet and ultimately with the standard
library's associative container insert function.

This lead to updating SmallSet::insert to return pair<iterator, bool>,
and then to update SmallPtrSet::insert to return pair<iterator, bool>,
and then to update all the existing users of those functions...

llvm-svn: 222334
2014-11-19 07:49:26 +00:00
Craig Topper
30281a67fb [C++11] More 'nullptr' conversion. In some cases just using a boolean check instead of comparing to nullptr.
llvm-svn: 206142
2014-04-14 00:51:57 +00:00
Rafael Espindola
a42d62f05f Add std prefixes to fix the build with xlc.
Patch by Kai <kai@redstar.de>.

llvm-svn: 177574
2013-03-20 21:00:22 +00:00
Jakob Stoklund Olesen
05ab4e5615 Fix broken ipo_ext_iterator constructors.
These functions have obviously never been used before.
They should be identical to the idf_ext_iterator counterparts.

llvm-svn: 160381
2012-07-17 17:57:25 +00:00
Jakob Stoklund Olesen
d489632f94 Allow for customized graph edge pruning in PostOrderIterator.h
Make it possible to prune individual graph edges from a post-order
traversal by specializing the po_iterator_storage template. Previously,
it was only possible to prune full graph nodes. Edge pruning makes it
possible to remove loop back-edges, for example.

Also replace the existing DFSetTraits customization hook with a
po_iterator_storage method for observing the post-order. DFSetTraits was
only used by LoopIterator.h which now provides a po_iterator_storage
specialization.

Thanks to Sean and Chandler for reviewing.

llvm-svn: 160366
2012-07-17 15:35:40 +00:00
Andrew Trick
b20e31e81f An interface for iterating over a loop's blocks in DFS order.
llvm-svn: 136838
2011-08-03 23:27:28 +00:00
Dan Gohman
a5cb7ac412 Optimize po_iterator: don't do redundant lookups.
llvm-svn: 125211
2011-02-09 19:25:31 +00:00
Duncan Sands
5338c9f877 Use std::vector rather than SmallVector here because SmallVector
causes some versions of gcc to crash when building LLVM.

llvm-svn: 107869
2010-07-08 13:06:08 +00:00
Duncan Sands
dcc1398f44 Do not use std::stack because it causes obscure failures when
compiled with MSVC 2010 (PR7367).  Instead use a SmallVector.

llvm-svn: 107867
2010-07-08 11:54:27 +00:00
Gabor Greif
0d4f085232 eliminate all 80-col violations that I have introduced in my recent checkins (and some others more)
llvm-svn: 80304
2009-08-27 23:44:33 +00:00
Gabor Greif
cc8681cea3 Clean up the minor mess I caused with removing iterator.h. I shall take care of 80-col violations and the FIXME later. (Thanks goodness that I live in another continent, so the monkeypox did not strike me :-)
llvm-svn: 80224
2009-08-27 06:41:46 +00:00
Chris Lattner
f480b139c8 fix a bug in post-order iterators with external storage, patch by
Olaf Krzikalla!

llvm-svn: 74933
2009-07-07 18:43:48 +00:00
Owen Anderson
3234d9d040 Owen Anderson 2009-06-15: Use a SmallPtrSet here, for speed and to match df_iterator.
Owen Anderson 2009-06-15: Remember to clear out our maps to prevent crashing.

llvm-svn: 73438
2009-06-15 22:54:48 +00:00
Misha Brukman
380e3db1b4 Fixed lint errors:
* Alphabetized #includes
* Removed trailing whitespace
* Wrapped or shortened lines over 80 chars

llvm-svn: 65181
2009-02-20 22:20:18 +00:00
Misha Brukman
da77da48f3 Removed trailing whitespace.
llvm-svn: 62000
2009-01-09 19:25:42 +00:00
Anton Korobeynikov
f77142326f For PR1338: rename include/llvm/ADT/ilist and friends to end with ".h"
llvm-svn: 51687
2008-05-29 17:41:17 +00:00
Chris Lattner
e0b1ee937a Don't attribute in file headers anymore. See llvmdev for the
discussion of this change.  Boy are my fingers tired. ;-)

llvm-svn: 45411
2007-12-29 19:59:42 +00:00
Owen Anderson
02c6c6bba7 Fix typo.
llvm-svn: 42256
2007-09-24 02:33:22 +00:00
Chris Lattner
ed45ad33b7 Make the LLVM headers "-ansi -pedantic -Wno-long-long" clean.
Patch by Martin Partel!

llvm-svn: 26313
2006-02-22 16:23:43 +00:00
Chris Lattner
2fbfb322b1 Remove a now-dead map, patch by Saem Ghani, thanks!
llvm-svn: 24629
2005-12-07 05:41:44 +00:00
Chris Lattner
18a2c21fc0 Implement external storage for post-order iteration, implementing PR267
Patch by Saem Ghani, thanks!

llvm-svn: 24617
2005-12-06 07:05:27 +00:00
Misha Brukman
d292737471 Convert tabs to spaces
llvm-svn: 21436
2005-04-22 03:27:20 +00:00
Misha Brukman
3f0aa3dbf8 Remove trailing whitespace
llvm-svn: 21408
2005-04-21 20:19:05 +00:00
Alkis Evlogimenos
4f5920aaef Add includes and use std:: for standard library calls to make code
compile on windows. This patch was contributed by Paolo Invernizzi.

llvm-svn: 16539
2004-09-28 14:42:44 +00:00
Reid Spencer
c4abcbefb1 Changes For Bug 352
Move include/Config and include/Support into include/llvm/Config,
include/llvm/ADT and include/llvm/Support. From here on out, all LLVM
public header files must be under include/llvm/.

llvm-svn: 16137
2004-09-01 22:55:40 +00:00