1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 20:12:56 +02:00
Commit Graph

213 Commits

Author SHA1 Message Date
Chandler Carruth
6f8cc37074 Remove 'static' from inline functions defined in header files.
There is a pretty staggering amount of this in LLVM's header files, this
is not all of the instances I'm afraid. These include all of the
functions that (in my build) are used by a non-static inline (or
external) function. Specifically, these issues were caught by the new
'-Winternal-linkage-in-inline' warning.

I'll try to just clean up the remainder of the clearly redundant "static
inline" cases on functions (not methods!) defined within headers if
I can do so in a reliable way.

There were even several cases of a missing 'inline' altogether, or my
personal favorite "static bool inline". Go figure. ;]

llvm-svn: 158800
2012-06-20 08:39:33 +00:00
Dan Gohman
c0a906405e Add forms of dominates and isReachableFromEntry that accept a Use
directly instead of a user Instruction. This allows them to test
whether a def dominates a particular operand if the user instruction
is a PHI.

llvm-svn: 154631
2012-04-12 23:31:46 +00:00
Rafael Espindola
6363adaa9f Make dominatedBySlowTreeWalk private and assert cases handled by the caller.
llvm-svn: 153905
2012-04-02 22:37:54 +00:00
Rafael Espindola
1fb406b0fb Add missing 'd'.
llvm-svn: 153872
2012-04-02 13:02:57 +00:00
Rafael Espindola
5eae79c8cf Add a workaround for building with old versions of clang.
llvm-svn: 153820
2012-03-31 21:54:20 +00:00
Rafael Espindola
151b420718 Handle unreachable code in the dominates functions. This changes users when
needed for correctness, but still doesn't clean up code that now unnecessary
checks for reachability.

llvm-svn: 153755
2012-03-30 16:46:21 +00:00
Rafael Espindola
c7312a8730 Avoid using dominatedBySlowTreeWalk.
llvm-svn: 153398
2012-03-24 22:52:25 +00:00
Rafael Espindola
34b7c064cb Change the implementation of dominates(inst, inst) to one based on what the
verifier does. This correctly handles invoke.
Thanks to Duncan, Andrew and Chris for the comments.
Thanks to Joerg for the early testing.

llvm-svn: 151469
2012-02-26 02:19:19 +00:00
Rafael Espindola
d9e654ca63 Don't call dominates on unreachable instructions.
llvm-svn: 151466
2012-02-26 01:50:14 +00:00
Andrew Trick
be3e9530e1 SCEVExpander fixes. Affects LSR and indvars.
LSR has gradually been improved to more aggressively reuse existing code, particularly existing phi cycles. This exposed problems with the SCEVExpander's sloppy treatment of its insertion point. I applied some rigor to the insertion point problem that will hopefully avoid an endless bug cycle in this area. Changes:

- Always used properlyDominates to check safe code hoisting.

- The insertion point provided to SCEV is now considered a lower bound. This is usually a block terminator or the use itself. Under no cirumstance may SCEVExpander insert below this point.

- LSR is reponsible for finding a "canonical" insertion point across expansion of different expressions.

- Robust logic to determine whether IV increments are in "expanded" form and/or can be safely hoisted above some insertion point.

Fixes PR11783: SCEVExpander assert.

llvm-svn: 148535
2012-01-20 07:41:13 +00:00
Benjamin Kramer
503550b85a Simplify code. No functionality change.
Using DenseMap iterators isn't free as they have to check for empty
buckets. Dominator queries are common so this gives a minor speedup.

llvm-svn: 147544
2012-01-04 20:20:08 +00:00
Anna Zaks
431b43fdbe Change the Dominators recalculate() function to only rely on GraphTraits
This is a patch by Guoping Long!

As part of utilizing LLVM Dominator computation in Clang, made two changes to LLVM dominators tree implementation:

 - (1) Change the recalculate() template function to only rely on GraphTraits.
 - (2) Add a size() method to GraphTraits template class to query the number of nodes in the graph.

llvm-svn: 145837
2011-12-05 19:17:04 +00:00
Cameron Zwarich
79cc467078 In the simpler version of the link-eval data structure that we use in dominator
computation, the Ancestor field is always set to the Parent, so we can remove
the explicit link entirely and merge the Parent and Ancestor fields. Instead of
checking for whether an ancestor exists for a node or not, we simply check
whether the node has already been processed. This is simpler if Compress is
inlined into Eval, so I did that as well.

This is about a 3% speedup running -domtree on test-suite + SPEC2000 & SPEC2006,
but it also opens up some opportunities for further improvement.

llvm-svn: 124061
2011-01-23 06:16:06 +00:00
Cameron Zwarich
f881ff46fe Remove useless struct fields.
llvm-svn: 124058
2011-01-23 05:11:18 +00:00
Cameron Zwarich
2f271f19aa Remove friend declaration for removed function.
llvm-svn: 124057
2011-01-23 04:54:34 +00:00
Jakob Stoklund Olesen
add3ef6ca2 Put the Dominator improvements back in. They were not the cause of bootstrap miscomparisons.
llvm-svn: 123273
2011-01-11 21:23:09 +00:00
Jakob Stoklund Olesen
264d2e5c08 Speculatively revert the recent improvements to Dominators.h in an attempt to track down the gcc bootstrap miscompare.
llvm-svn: 123254
2011-01-11 19:26:30 +00:00
Tobias Grosser
8dadf82d11 DominatorTree->print() now prints the status of the DFSNumbers correctly
llvm-svn: 123120
2011-01-09 16:00:09 +00:00
Chris Lattner
e396e846b4 split dom frontier handling stuff out to its own DominanceFrontier header,
so that Dominators.h is *just* domtree.  Also prune #includes a bit.

llvm-svn: 122714
2011-01-02 22:09:33 +00:00
Cameron Zwarich
482eeb4c8e Remove an unused member function.
llvm-svn: 122693
2011-01-02 12:37:22 +00:00
Cameron Zwarich
c8a0461c46 Speed up dominator computation some more by optimizing bucket processing. When
naively implemented, the Lengauer-Tarjan algorithm requires a separate bucket
for each vertex. However, this is unnecessary, because each vertex is only
placed into a single bucket (that of its semidominator), and each vertex's
bucket is processed before it is added to any bucket itself.

Instead of using a bucket per vertex, we use a single array Buckets that has two
purposes. Before the vertex V with DFS number i is processed, Buckets[i] stores
the index of the first element in V's bucket. After V's bucket is processed,
Buckets[i] stores the index of the next element in the bucket to which V now
belongs, if any.

Reading from the buckets can also be optimized. Instead of processing the bucket
of V's parent at the end of processing V, we process the bucket of V itself at
the beginning of processing V. This means that the case of the root vertex can
be simplified somewhat. It also means that we don't need to look up the DFS
number of the semidominator of every node in the bucket we are processing,
since we know it is the current index being processed.

This is a 6.5% speedup running -domtree on test-suite + SPEC2000/2006, with
larger speedups of around 12% on the larger benchmarks like GCC.

llvm-svn: 122680
2011-01-02 07:03:00 +00:00
Dan Gohman
db69a33d9f Constify.
llvm-svn: 122447
2010-12-22 22:10:08 +00:00
Owen Anderson
46990c17f7 Get rid of static constructors for pass registration. Instead, every pass exposes an initializeMyPassFunction(), which
must be called in the pass's constructor.  This function uses static dependency declarations to recursively initialize
the pass's dependencies.

Clients that only create passes through the createFooPass() APIs will require no changes.  Clients that want to use the
CommandLine options for passes will need to manually call the appropriate initialization functions in PassInitialization.h
before parsing commandline arguments.

I have tested this with all standard configurations of clang and llvm-gcc on Darwin.  It is possible that there are problems
with the static dependencies that will only be visible with non-standard options.  If you encounter any crash in pass
registration/creation, please send the testcase to me directly.

llvm-svn: 116820
2010-10-19 17:21:58 +00:00
Dan Gohman
52980b97f9 Constify isReachableFromEntry.
llvm-svn: 115788
2010-10-06 15:49:14 +00:00
Dan Gohman
3c72647fd5 Constify properlyDominates in the same manner as dominates.
Add constified overloads for findNearestCommonDominator.

llvm-svn: 114834
2010-09-27 16:33:31 +00:00
Gabor Greif
dfe6dea95f typoes
llvm-svn: 113647
2010-09-10 22:25:58 +00:00
Owen Anderson
f2fea95f2f Reapply r110396, with fixes to appease the Linux buildbot gods.
llvm-svn: 110460
2010-08-06 18:33:48 +00:00
Owen Anderson
aadd8a89ca Revert r110396 to fix buildbots.
llvm-svn: 110410
2010-08-06 00:23:35 +00:00
Owen Anderson
b9762c07cb Don't use PassInfo* as a type identifier for passes. Instead, use the address of the static
ID member as the sole unique type identifier.  Clean up APIs related to this change.

llvm-svn: 110396
2010-08-05 23:42:04 +00:00
Tobias Grosser
97dc00d1d8 Add dump() to DominanceFrontier
llvm-svn: 108512
2010-07-16 05:59:39 +00:00
Gabor Greif
4d880ebd36 fix clang selfhost issue (shadowing)
llvm-svn: 107970
2010-07-09 14:46:49 +00:00
Gabor Greif
0da64e7003 refactor type expressions and cache operator*'s result
llvm-svn: 107964
2010-07-09 14:00:56 +00:00
Dan Gohman
0422fad3a6 Don't bother calling releaseMemory before destroying the DominatorTreeBase.
llvm-svn: 106287
2010-06-18 16:09:11 +00:00
Dan Gohman
ceebefeefb Fix coding style.
llvm-svn: 99362
2010-03-24 00:27:49 +00:00
Dan Gohman
7e7698c5a1 Generalize findNearestCommonDominator to work on post-dominators,
based on a suggestion by Jochen Wilhelmy.

llvm-svn: 99361
2010-03-24 00:22:24 +00:00
Dan Gohman
296af95bf9 Whitespace cleanups.
llvm-svn: 97452
2010-03-01 17:47:21 +00:00
Tobias Grosser
b73235c0d0 Add assert to check dominance dfs numbers.
Compare the dominance information calculated using a dominance tree walk to the
information calculated based on DFS numbers, if XDEBUG is enabled.

llvm-svn: 92969
2010-01-07 23:50:41 +00:00
Tobias Grosser
35528e6f1d Remove workaround in PostDominators
Remove a FIXME and unify code that was necessary to work around broken
updateDFSNumbers().  Before updateDFSNumbers() did not work correctly for post
dominators.

llvm-svn: 92968
2010-01-07 23:50:25 +00:00
Tobias Grosser
fbc9ea7841 Fix DFS number calculation for postdominators
The DFS number calculation for postdominators was broken. In the case of
multiple exits that form the post dominator root nodes, do not iterate over
all exits, but start from the virtual root node. Otherwise bbs, that are not
post dominated by any exit but by the virtual root node, will never be assigned
a DFS number.

llvm-svn: 92967
2010-01-07 23:50:06 +00:00
Benjamin Kramer
879350e223 Remove dead variable found by clang++.
llvm-svn: 88803
2009-11-14 19:51:20 +00:00
Dan Gohman
d60e3bf386 Make DominanceFrontier::addBasicBlock return the iterator for the newly
inserted block.

llvm-svn: 85010
2009-10-24 19:57:58 +00:00
Chris Lattner
634b65ee79 add nodes_begin/end/iterator for dominfo, patch by Tobias Grosser!
llvm-svn: 84395
2009-10-18 04:05:53 +00:00
Dan Gohman
bd50ec69e4 Move the dominator verification code out of special code embedded within
the PassManager code into a regular verifyAnalysis method.

Also, reorganize loop verification. Make the LoopPass infrastructure
call verifyLoop as needed instead of having LoopInfo::verifyAnalysis
check every loop in the function after each looop pass. Add a new
command-line argument, -verify-loop-info, to enable the expensive
full checking.

llvm-svn: 82952
2009-09-28 00:27:48 +00:00
Chris Lattner
1ceac42392 move DominatorTree::dominates for instructions out of line,
no functionality change.

llvm-svn: 82490
2009-09-21 22:30:50 +00:00
Chris Lattner
fb09f6e5ea fix PR4915, a crash in -debug mode.
llvm-svn: 81177
2009-09-08 01:22:54 +00:00
Dan Gohman
58b376193d Add const qualifiers to dominates' arguments.
llvm-svn: 80801
2009-09-02 17:05:05 +00:00
Dan Gohman
ebfea6a655 Be somewhat more consistent about const qualifiers.
llvm-svn: 80264
2009-08-27 17:54:15 +00:00
Dan Gohman
e4b0f12a19 Strip trailing whitespace from blank lines.
llvm-svn: 80259
2009-08-27 17:29:49 +00:00
Chris Lattner
1c0452caeb Change Pass::print to take a raw ostream instead of std::ostream,
update all code that this affects.

llvm-svn: 79830
2009-08-23 06:03:38 +00:00
Chris Lattner
ea2bfd7a9f eliminate the std::ostream form of WriteAsOperand and update clients.
This also updates dominator related stuff.

llvm-svn: 79825
2009-08-23 05:17:37 +00:00