1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 11:33:24 +02:00
Commit Graph

137 Commits

Author SHA1 Message Date
Owen Anderson
229333c94b Add a first attempt at dominator information for MBB's. Use with caution: this has been tested to compile. It has not yet been confirmed to generate correct analysis.
llvm-svn: 43438
2007-10-29 04:50:50 +00:00
Owen Anderson
dc3329dbf7 Make it possible for DomTreeBase to be constructed from MachineFunction's as well as just Function's.
llvm-svn: 43321
2007-10-25 00:16:57 +00:00
Owen Anderson
52b33065a4 Make DomTreeBase not a FunctionPass.
llvm-svn: 43263
2007-10-23 21:42:49 +00:00
Owen Anderson
962303b4ef Unbreak the build. Forgot to commit this file.
llvm-svn: 43260
2007-10-23 21:04:37 +00:00
Owen Anderson
4b407757d0 Move Split<...>() into DomTreeBase. This should make the #include's of DominatorInternals.h
in CodeExtractor and LoopSimplify unnecessary.

Hartmut, could you confirm that this fixes the issues you were seeing?

llvm-svn: 43115
2007-10-18 05:13:52 +00:00
Hartmut Kaiser
ed12f66488 Updated VC++ build system.
Silenced some VC warnings.

I'm getting linker errors, though: unresolved externals:

llvm::Split<class llvm::BasicBlock *,struct llvm::GraphTraits<class llvm::BasicBlock *> >(class llvm::DominatorTreeBase<class llvm::BasicBlock> &,class llvm::BasicBlock *)

and

llvm::Split<struct llvm::Inverse<class llvm::BasicBlock *>,struct llvm::GraphTraits<struct llvm::Inverse<class llvm::BasicBlock *> > >(class llvm::DominatorTreeBase<class llvm::BasicBlock> &,class llvm::BasicBlock *)

Where are these defined?

llvm-svn: 43073
2007-10-17 14:56:40 +00:00
Owen Anderson
1235d1218b Move splitBlock into DomTreeBase from DomTree.
llvm-svn: 43059
2007-10-17 02:03:17 +00:00
Owen Anderson
315471786b Fix some formatting.
llvm-svn: 43049
2007-10-16 22:59:15 +00:00
Owen Anderson
43fefb53a6 Template DominatorTreeBase by node type. This is the next major step towards
having dominator information on MBB's.

llvm-svn: 43036
2007-10-16 19:59:25 +00:00
Owen Anderson
ffcd82d1ed Begin the process of allowing DomTree on MBB's. Step One: template DomTreeNode by making it a typedef of a templated DomTreeNodeBase.
llvm-svn: 42743
2007-10-08 07:44:39 +00:00
Owen Anderson
cb51170957 Completely merge the implementation details of DomTree and PostDomTree.
Also, add a FIXME for a bug in PostDomTree calculation I noticed while writing this,

llvm-svn: 42593
2007-10-03 21:25:45 +00:00
Owen Anderson
09ba812a80 Template-ize more of the DomTree internal implementation details. Only the calculate() methods for DomTree and PostDomTree remain to be merged/template-ized.
llvm-svn: 42476
2007-09-30 04:17:16 +00:00
Owen Anderson
a533c458f5 Have PostDomTree use the newly templated DFSPass.
llvm-svn: 42427
2007-09-28 01:23:47 +00:00
Owen Anderson
e529f66979 Convert DFSPass into a templated friend function, in preparation for making it common to DomTree and PostDomTree.
llvm-svn: 42420
2007-09-27 23:23:00 +00:00
Owen Anderson
a0a11ee8b9 Merge significant portions of the DomTree and PostDomTree implementations.
The two remaining unmerged parts are DFSPass, and the Calculate().

llvm-svn: 42255
2007-09-24 02:29:29 +00:00
Owen Anderson
677db80624 Move DFSPass back down into DominatorTree. I need to figure out what the difference is between it
and the PostDomTree version first.

llvm-svn: 42250
2007-09-23 22:16:38 +00:00
Owen Anderson
de1937fcee Factor the dominator tree calculation details out into DominatorCalculation.h. This
change is not useful in and of itself, but it lays the groundwork for combining
the dominator and postdominator implementations.

Also, factor a few methods that are common to DominatorTree and PostDominatorTree
into DominatorTreeBase.  Again, this will make merging the two calculation methods
simpler in the future.

llvm-svn: 42248
2007-09-23 21:31:44 +00:00
Nick Lewycky
068c7d20e2 Simplify.
llvm-svn: 41167
2007-08-18 14:46:55 +00:00
Devang Patel
fded73828f When one branch of condition is eliminated then head of the other
branch is not necessary immediate dominators of merge blcok in all cases.

llvm-svn: 41144
2007-08-17 21:59:16 +00:00
Devang Patel
35c1c452b0 No need to use iterator to erase basic block.
llvm-svn: 41074
2007-08-14 16:53:24 +00:00
Devang Patel
993388b1ee Add methods to erase basic block entry.
llvm-svn: 41052
2007-08-13 22:10:29 +00:00
Reid Spencer
8c5c7c8453 Change casts from old style to new style. This helps document the details
better, gives the compiler a chance to validate the cast and reduces warnings
if the user turns on -Wold-style-cast option.

llvm-svn: 41033
2007-08-12 08:12:35 +00:00
Chris Lattner
65d638a918 reimplement dfs number computation to be significantly faster. This speeds up
natural loop canonicalization (which does many cfg xforms) by 4.3x, for 
example.  This also fixes a bug in postdom dfnumber computation.

llvm-svn: 40920
2007-08-08 05:51:24 +00:00
Chris Lattner
99df553268 Various random cleanups, add two accessors to DomTreeNode: getDFSNumIn/getDFSNumOut
llvm-svn: 40856
2007-08-06 06:15:43 +00:00
Chris Lattner
a5a692b9bb Switch the internal "Info" map from an std::map to a DenseMap. This
speeds up idom by about 45% and postidom by about 33%.

Some extra precautions must be taken not to invalidate densemap iterators.

llvm-svn: 40827
2007-08-05 00:02:00 +00:00
Chris Lattner
5912537997 switch the DomTreeNodes and IDoms maps in idom/postidom to a
DenseMap instead of an std::map.  This speeds up postdomtree
by about 25% and domtree by about 23%.  It also speeds up clients,
for example, domfrontier by 11%, mem2reg by 4% and ADCE by 6%.

llvm-svn: 40826
2007-08-04 23:48:07 +00:00
Devang Patel
7d791bb10c Remove unused method - getIDomBlock().
llvm-svn: 37865
2007-07-04 01:11:19 +00:00
Devang Patel
6e6a5c1893 Fix typo in assertion check.
llvm-svn: 37864
2007-07-04 01:05:22 +00:00
Devang Patel
2f757c3a96 Remove unnecessary comments.
llvm-svn: 37774
2007-06-28 02:11:54 +00:00
Devang Patel
ce4ea8a62c Handle the case when block dominates itself.
llvm-svn: 37773
2007-06-28 02:07:08 +00:00
Devang Patel
28d2851f39 Remove ETForest.
llvm-svn: 37765
2007-06-27 20:53:52 +00:00
Devang Patel
bfb1c7192e Move code to update dominator information after basic block is split
from LoopSimplify.cpp to Dominator.cpp

llvm-svn: 37689
2007-06-21 17:23:45 +00:00
Devang Patel
ca555be4ca Protect updateDFSNumbers()
llvm-svn: 37560
2007-06-12 17:30:56 +00:00
Devang Patel
73ae5acfd0 Make DFS number manipulation methods private.
llvm-svn: 37553
2007-06-12 05:49:31 +00:00
Devang Patel
ab4cb51479 Break DominatorTree from ETNode.
Remove unused PostETForest.

llvm-svn: 37551
2007-06-12 00:54:38 +00:00
Devang Patel
73d23a5f70 Maintain DFS number in DomTreeNode itself.
This means now ETNodes are not useful anymore.

llvm-svn: 37546
2007-06-12 00:14:41 +00:00
Devang Patel
bc3887310b Add and use DominatorTreeBase::findNearestCommonDominator().
llvm-svn: 37545
2007-06-11 23:31:22 +00:00
Devang Patel
d1a779c4fe Fix spelling.
llvm-svn: 37522
2007-06-08 17:59:02 +00:00
Devang Patel
cfb3a761ae Update LoopSimplify to require and preserve DominatorTree only.
Now LoopSimplify does not require nor preserve ETForest.

llvm-svn: 37512
2007-06-08 01:50:32 +00:00
Devang Patel
738f460b18 Add new method - nearestCommonDominator().
llvm-svn: 37508
2007-06-08 00:21:17 +00:00
Devang Patel
9772222f41 Add instruction level dominates(A,B) interface.
llvm-svn: 37504
2007-06-07 23:52:40 +00:00
Devang Patel
3daf3625ab Do not use ETForest as well as DomiantorTree. DominatorTree is sufficient.
llvm-svn: 37501
2007-06-07 22:17:16 +00:00
Devang Patel
3aece48470 Add basic block level properlyDominates(A,B) interface.
llvm-svn: 37497
2007-06-07 21:34:22 +00:00
Devang Patel
e63f8b85f7 Add BasicBlock level dominates(A,B) interface.
llvm-svn: 37493
2007-06-07 18:39:40 +00:00
Devang Patel
babcd06827 Maintain ETNode as part of DomTreeNode.
This adds redundancy for now.

llvm-svn: 37492
2007-06-07 17:47:21 +00:00
Devang Patel
782ec1fbbb Break friendship.
llvm-svn: 37450
2007-06-06 00:59:48 +00:00
Devang Patel
43c684a62d Simplify class hierarchy.
llvm-svn: 37447
2007-06-06 00:46:36 +00:00
Devang Patel
ba29e5e591 s/ETNode::getChildren/ETNode::getETNodeChildren/g
llvm-svn: 37426
2007-06-04 23:45:02 +00:00
Devang Patel
3ad9b9f927 Add FIXMEs.
llvm-svn: 37417
2007-06-04 17:38:00 +00:00
Devang Patel
8faaa37b1a Remove unused method.
llvm-svn: 37416
2007-06-04 16:49:36 +00:00