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
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
Devang Patel
74785c1f3c s/DominatorTree::createNewNode/DominatorTree::addNewBlock/g
llvm-svn: 37415
2007-06-04 16:43:25 +00:00
Devang Patel
26d8a86df7 Add basic block level interface to change immediate dominator
and create new node.

llvm-svn: 37414
2007-06-04 16:22:33 +00:00
Devang Patel
2ef6caf14f s/llvm::DominatorTreeBase::DomTreeNode/llvm::DomTreeNode/g
llvm-svn: 37407
2007-06-04 00:32:22 +00:00
Devang Patel
d58b82f83a s/DominatorTreeBase::Node/DominatorTreeBase:DomTreeNode/g
llvm-svn: 37403
2007-06-03 06:26:14 +00:00
Devang Patel
bf5c49f62c Add dump() routines for debugging assistance.
llvm-svn: 37314
2007-05-23 19:55:36 +00:00
Chris Lattner
82c4362a67 update comments
llvm-svn: 37027
2007-05-14 01:54:16 +00:00
Nick Lewycky
c2306ff5b4 Fix typo in comment.
llvm-svn: 36873
2007-05-06 13:37:16 +00:00
Devang Patel
e0b9bd0e49 Use iterative while loop instead of recursive function call.
llvm-svn: 36694
2007-05-03 20:55:18 +00:00
Devang Patel
cd45427a87 Drop 'const'
llvm-svn: 36662
2007-05-03 01:11:54 +00:00
Devang Patel
8ee9065162 Use 'static const char' instead of 'static const int'.
Due to darwin gcc bug, one version of darwin linker coalesces
static const int, which defauts PassID based pass identification.

llvm-svn: 36652
2007-05-02 21:39:20 +00:00
Devang Patel
38a66bc82e Do not use typeinfo to identify pass in pass manager.
llvm-svn: 36632
2007-05-01 21:15:47 +00:00
Owen Anderson
2767bc3188 Fix some null checks to actually test the part that needs checking.
llvm-svn: 36298
2007-04-21 07:04:45 +00:00
Owen Anderson
e49ca2c78b Add null checks and const-ify these accessors.
llvm-svn: 36270
2007-04-20 05:44:16 +00:00
Owen Anderson
c08636e1f0 Add accessor to get the blocks immediately dominated by a given block to ETForest.
llvm-svn: 36251
2007-04-18 05:25:09 +00:00
Owen Anderson
7553394275 Add an accessor to make ETForest more useful.
llvm-svn: 36246
2007-04-18 04:38:39 +00:00
Owen Anderson
b371956400 Tabs -> Spaces
llvm-svn: 36094
2007-04-15 23:14:18 +00:00
Owen Anderson
ea857029ea Remove ImmediateDominator analysis. The same information can be obtained from DomTree. A lot of code for
constructing ImmediateDominator is now folded into DomTree construction.

This is part of the ongoing work for PR217.

llvm-svn: 36063
2007-04-15 08:47:27 +00:00
Owen Anderson
41582c8198 Make ETForest depend on DomTree rather than IDom. This is the first step
in the long process that will be fixing PR 217.

llvm-svn: 36034
2007-04-14 23:49:24 +00:00
Owen Anderson
e4c29f0b01 Move isReachableFromEntry out of line to avoid an unnecessary #include
llvm-svn: 35797
2007-04-09 04:07:36 +00:00
Owen Anderson
f9a432a613 Cleanup some from my DomSet-removal changes. Add a new
isReachableFromEntry
test to ETForest to factor a common test out of code.

llvm-svn: 35786
2007-04-09 00:52:49 +00:00
Owen Anderson
4b323657b9 Remove DomSet completely. This concludes work on PR1171.
llvm-svn: 35775
2007-04-08 21:30:05 +00:00
Owen Anderson
7cf9d12f2e Add DomSet back, and revert the changes to LoopSimplify. Apparently the
ETForest updating mechanisms don't work as I thought they did.  These changes
will be reapplied once the issue is worked out.

llvm-svn: 35741
2007-04-07 18:23:27 +00:00
Owen Anderson
85b0e20f2a Completely purge DomSet. This is the (hopefully) final patch for PR1171.
llvm-svn: 35731
2007-04-07 07:17:27 +00:00
Devang Patel
19dae84536 LoopSimplify::FindPHIToPartitionLoops()
Use ETForest instead of DominatorSet.

llvm-svn: 35222
2007-03-20 20:19:48 +00:00
Bill Wendling
7f6a73eb5c Added an automatic cast to "std::ostream*" etc. from OStream. We then can
rework the hacks that had us passing OStream in. We pass in std::ostream*
instead, check for null, and then dispatch to the correct print() method.

llvm-svn: 32636
2006-12-17 05:15:13 +00:00
Jeff Cohen
e1003da1a2 Unbreak VC++ build.
llvm-svn: 31464
2006-11-05 19:31:28 +00:00
Chris Lattner
895cf34500 Move DominatorTree to immediately follow DominatorTreeBase
llvm-svn: 30693
2006-10-03 05:24:56 +00:00
Nick Lewycky
a2c3d7b1ca Add ability to remove nodes from DominatorTree, for when a BasicBlock
is being removed.

llvm-svn: 30270
2006-09-12 00:18:28 +00:00
Chris Lattner
58aeae17a7 Add dominates/properlyDominates queries to IDom.
llvm-svn: 29456
2006-08-01 22:24:47 +00:00
Reid Spencer
560366562b For PR780:
1. Fix the macros in IncludeFile.h to put everything in the llvm namespace
2. Replace the previous explicit mechanism in all the .h and .cpp files
   with the macros in IncludeFile.h
This gets us a consistent mechanism throughout LLVM for ensuring linkage.
Next step is to make sure its used in enough places.

llvm-svn: 28715
2006-06-07 22:00:26 +00:00
Reid Spencer
2c6d390a60 Change from using a stub function to a stub variable for passing to the
IncludeFile hack to ensure linkage of analysis passes. This works around
some -pedantic warnings about assigning an object to a function.

llvm-svn: 28621
2006-06-01 07:02:51 +00:00
Chris Lattner
0f467023c2 Fix pastos in comments
llvm-svn: 28522
2006-05-27 06:57:55 +00:00
Chris Lattner
fce3b3f299 Use class tags instead of struct tags. The coding standards specify this
for public classes for improved win32 compatibility.

llvm-svn: 28391
2006-05-19 17:17:12 +00:00
Nate Begeman
31da564faa Move some common data structures between dom and pdom into the base class
llvm-svn: 26905
2006-03-20 19:32:48 +00:00
Chris Lattner
551df64bd0 Change ET-Forest to automatically recalculate its DFSnum's if too many slow
queries are made.

Patch by Daniel Berlin!

llvm-svn: 25323
2006-01-14 20:55:09 +00:00
Chris Lattner
84a9d11b28 Initial implementation of the ET-Forest data structure for dominators and
post-dominators.  This code was written/adapted by Daniel Berlin!

llvm-svn: 25144
2006-01-08 08:22:18 +00:00
Chris Lattner
8154ba119b Fix PR670 and test/Regression/Transforms/Mem2Reg/2005-11-28-Crash.ll
llvm-svn: 24508
2005-11-29 01:07:12 +00:00
Chris Lattner
a19b6a0800 Fix the dominates method to return true if the two nodes are the same. Add
a new properlyDominates method to do what the old one did.

llvm-svn: 24407
2005-11-18 07:27:33 +00:00
Misha Brukman
3f0aa3dbf8 Remove trailing whitespace
llvm-svn: 21408
2005-04-21 20:19:05 +00:00
Reid Spencer
d50c86f078 For PR387:\
Make only one print method to avoid overloaded virtual warnings when \
compiled with -Woverloaded-virtual

llvm-svn: 18589
2004-12-07 04:03:45 +00:00
Chris Lattner
dd0094e4ed Convert 'struct' to 'class' in various places to adhere to the coding standards
and work better with VC++.  Patch contributed by Morten Ofstad!

llvm-svn: 17281
2004-10-27 16:14:51 +00:00
Chris Lattner
df0849be71 Make sure any client of Dominators.h links in Dominators.cpp
llvm-svn: 16986
2004-10-14 15:46:59 +00:00
Chris Lattner
628e839194 It's not clear to me whether the old version was correct C++ code, but in
any case it's not portable.

llvm-svn: 13621
2004-05-21 18:38:16 +00:00
Misha Brukman
6ed546e3d2 Doxygenified and cleand up comments.
llvm-svn: 12294
2004-03-11 23:08:20 +00:00
Chris Lattner
d4abe8d28a The recalclulate method was a nasty hack that was once used by the -cee pass,
which never worked itself.  The cee pass still doesn't work, but it doesn't use
this method anymore anyway, so eliminate the method.

llvm-svn: 10302
2003-12-07 00:55:32 +00:00
Chris Lattner
c96fd2cf0c Rewrite dominators implementation. Now domset is constructed from immdom,
instead of the other way around.

llvm-svn: 10300
2003-12-07 00:36:16 +00:00
Brian Gaeke
d25f86d683 Put all LLVM code into the llvm namespace, as per bug 109.
llvm-svn: 9903
2003-11-11 22:41:34 +00:00
John Criswell
16c6cda9d5 Added LLVM copyright header (for lack of a better term).
llvm-svn: 9304
2003-10-20 20:19:47 +00:00
Chris Lattner
27fcbcd3a3 Get rid of the whole "Node2" business, rename getNode() ->getBlock() to
be more descriptive

llvm-svn: 8468
2003-09-11 16:25:06 +00:00
Chris Lattner
e7c33c0f65 Rework dominator and post dominator information so that we do not have to
unify all exit nodes of a function to compute post-dominance information.
This does not work with functions that have both unwind and return nodes,
because we cannot unify these blocks.  The new implementation is better
anyway. :)

llvm-svn: 8459
2003-09-10 20:36:51 +00:00
Chris Lattner
2e6dfe808d Add new methods, update comments
llvm-svn: 7962
2003-08-18 22:10:57 +00:00
Misha Brukman
56f7db4178 Spell `necessary' correctly.
llvm-svn: 7944
2003-08-18 14:43:39 +00:00
John Criswell
258dfc0319 Merged in autoconf branch. This provides configuration via the autoconf
system.

llvm-svn: 7014
2003-06-30 21:59:07 +00:00
Chris Lattner
6c12776232 Remove a ton of extraneous #includes
llvm-svn: 6842
2003-06-22 03:08:05 +00:00
John Criswell
4781723de6 Included assert.h so that the code compiles under newer versions of GCC.
llvm-svn: 6682
2003-06-11 14:01:36 +00:00
Chris Lattner
cf6eb5232a Add more graph traits specializations for dominator tree nodes
llvm-svn: 5751
2003-03-20 21:21:05 +00:00
Chris Lattner
db73d0ceab Make the interface to update a little more efficient
llvm-svn: 5651
2003-02-27 20:24:17 +00:00
Chris Lattner
2e98413a27 Add interface to update domfrontier info, thanks to Casey Carter for impl
llvm-svn: 4456
2002-10-31 02:39:48 +00:00
Chris Lattner
80332e579c Use the forward declaration for GraphTraits instead of #including
the header

llvm-svn: 4210
2002-10-17 01:36:08 +00:00
Joel Stanley
128e78631f Added partial specialization of GraphTraits for the DominatorTree class.
llvm-svn: 4205
2002-10-16 23:26:00 +00:00
Chris Lattner
b9f59f1533 Expose new "recalculate" method from dominatorset
llvm-svn: 4074
2002-10-08 19:12:08 +00:00
Chris Lattner
5c3fdd02af Simplify code a bit, add an assertion
llvm-svn: 3974
2002-09-29 21:37:08 +00:00
Chris Lattner
dee21da2c0 - Add methods to ImmediateDominators & DominatorTree to allow updates
- Make DominatorTree::Node not inherit from std::vector

llvm-svn: 3938
2002-09-26 16:14:37 +00:00
Chris Lattner
aebc47d30a Add a new "DominatorSet::addDominator" method to allow updates
llvm-svn: 3937
2002-09-26 05:42:47 +00:00
Chris Lattner
d8e9501bf5 - Doxygenize comments
- Add new method to dominatorset: properlyDominates
- Add synonmys for operator[] to classes so that pointers to dominator
  information can be used more easily.
- Add API's to update dominator information

llvm-svn: 3585
2002-09-06 02:16:27 +00:00
Chris Lattner
5d3710be84 Fix bug: test/Regression/Assembler/2002-08-22-DominanceProblem.ll
llvm-svn: 3473
2002-08-22 20:39:27 +00:00
Chris Lattner
c4bd846e84 - Split Dominators.h into Dominators.h & PostDominators.h
llvm-svn: 3432
2002-08-21 23:43:50 +00:00
Chris Lattner
b90f78e2b3 - Do not expose ::ID from any of the analyses anymore.
llvm-svn: 3416
2002-08-21 17:09:45 +00:00
Chris Lattner
a21e315db4 - Cleaned up the interface to AnalysisUsage to take analysis class names
instead of ::ID's.
 - Pass::getAnalysis<> now no longer takes an optional argument

llvm-svn: 3265
2002-08-08 19:01:30 +00:00
Chris Lattner
ef6729c9ca * Eliminate the Provided set. All Passes now finally just automatically
provide themselves.

llvm-svn: 3125
2002-07-29 21:03:38 +00:00
Chris Lattner
3f47f1065b * Standardize how analysis results/passes as printed with the print() virtual
methods
* Eliminate AnalysisID:  Now it is just a typedef for const PassInfo*
* Simplify how AnalysisID's are initialized
* Eliminate Analysis/Writer.cpp/.h: incorporate printing functionality into
  the analyses themselves.

llvm-svn: 3115
2002-07-27 01:12:15 +00:00
Chris Lattner
ea9fb2a20a *** empty log message ***
llvm-svn: 3111
2002-07-26 21:11:42 +00:00
Chris Lattner
e056a17a88 *** empty log message ***
llvm-svn: 3107
2002-07-26 19:19:31 +00:00
Chris Lattner
27272ee812 Simplify analyses so that there is only one analysis per class
llvm-svn: 3104
2002-07-26 18:40:06 +00:00
Chris Lattner
dfd421a7df MEGAPATCH checkin.
For details, See: docs/2002-06-25-MegaPatchInfo.txt

llvm-svn: 2779
2002-06-25 16:13:24 +00:00
Chris Lattner
2735171cf5 Add method to check to see if two _Instructions_ dominate each other
llvm-svn: 2616
2002-05-13 22:03:16 +00:00
Chris Lattner
589debc4ba Add new optional getPassName() virtual function that a Pass can override
to make debugging output a lot nicer.

llvm-svn: 2395
2002-04-29 14:57:45 +00:00
Chris Lattner
f043c4baac Remove all contents of the cfg namespace to the global namespace
llvm-svn: 2369
2002-04-28 16:19:42 +00:00
Chris Lattner
741453dd60 Change the Dominator info and LoopInfo classes to keep track of BasicBlock's, not
const BasicBlocks

llvm-svn: 2337
2002-04-28 00:15:57 +00:00
Chris Lattner
536cf1b13f * Rename MethodPass class to FunctionPass
- Rename runOnMethod to runOnFunction
* Transform getAnalysisUsageInfo into getAnalysisUsage
  - Method is now const
  - It now takes one AnalysisUsage object to fill in instead of 3 vectors
    to fill in
  - Pass's now specify which other passes they _preserve_ not which ones
    they modify (be conservative!)
  - A pass can specify that it preserves all analyses (because it never
    modifies the underlying program)
* s/Method/Function/g in other random places as well

llvm-svn: 2333
2002-04-27 06:56:12 +00:00
Chris Lattner
c481e92886 Rename Method to Function
llvm-svn: 1957
2002-03-23 22:51:58 +00:00
Chris Lattner
3ce0567bac Convert analyses over to new Pass framework
llvm-svn: 1595
2002-01-30 23:27:55 +00:00
Chris Lattner
3dc9a2a61f Changes to build successfully with GCC 3.02
llvm-svn: 1503
2002-01-20 22:54:45 +00:00
Chris Lattner
99189a2ebf Changes to compile with GCC 2.96
llvm-svn: 745
2001-10-13 06:25:03 +00:00
Chris Lattner
f1f61a28cc * Add a DominatorBase base class to maintain root of Dominator info
* Implement post dominator support

llvm-svn: 140
2001-07-06 16:57:21 +00:00
Chris Lattner
94ca55178d Update documentation a bit, correct #include guard
llvm-svn: 127
2001-07-03 05:35:23 +00:00
Chris Lattner
4a9f31a0a7 Add new anaysis routines for building dominator related information
llvm-svn: 122
2001-07-02 05:45:17 +00:00