Commit Graph

102 Commits

Author SHA1 Message Date
Devang Patel d50859e87b Add dump() routines for debugging assistance.
llvm-svn: 37314
2007-05-23 19:55:36 +00:00
Devang Patel 2acc9769cc Use iterative while loop instead of recursive function call.
llvm-svn: 36694
2007-05-03 20:55:18 +00:00
Devang Patel 8c78a0bff0 Drop 'const'
llvm-svn: 36662
2007-05-03 01:11:54 +00:00
Devang Patel e95c6ad802 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 09f162ca6a Do not use typeinfo to identify pass in pass manager.
llvm-svn: 36632
2007-05-01 21:15:47 +00:00
Devang Patel 2e2518cc2e Reset vertex.
Fix http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20070416/048092.html

llvm-svn: 36294
2007-04-21 00:36:45 +00:00
Owen Anderson f064c92298 Tabs -> Spaces
llvm-svn: 36094
2007-04-15 23:14:18 +00:00
Owen Anderson f35a1dbc7a 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 e59b36defa Fix some unsafe code. Also, tabs -> spaces.
llvm-svn: 36035
2007-04-14 23:57:00 +00:00
Owen Anderson 78cecc817f 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
Chris Lattner d112a031ea Convert ImmediateDominators::DFSPass from being recursive to being iterative.
llvm-svn: 35815
2007-04-09 06:44:42 +00:00
Chris Lattner 0a5677d912 minor cleanups
llvm-svn: 35807
2007-04-09 06:10:06 +00:00
Owen Anderson 6978893a8f Move isReachableFromEntry out of line to avoid an unnecessary #include
llvm-svn: 35797
2007-04-09 04:07:36 +00:00
Owen Anderson fe507270ac Remove DomSet completely. This concludes work on PR1171.
llvm-svn: 35775
2007-04-08 21:30:05 +00:00
Nick Lewycky 73ffedb592 Don't crash when encountering a BasicBlock that hasn't been registered yet.
llvm-svn: 35756
2007-04-08 01:02:12 +00:00
Owen Anderson f7ebea1b9f 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 8763ba1b88 Completely purge DomSet. This is the (hopefully) final patch for PR1171.
llvm-svn: 35731
2007-04-07 07:17:27 +00:00
Devang Patel 0b013d578d It is not possible to determine dominance between two PHI nodes
based on their ordering. This is applicable to ETForest::dominates() also.

llvm-svn: 35423
2007-03-28 14:57:43 +00:00
Devang Patel 5a1bd4045d Use SmallPtrSet.
llvm-svn: 35388
2007-03-27 20:50:46 +00:00
Devang Patel 2850c677af Spell check.
llvm-svn: 35374
2007-03-27 00:16:08 +00:00
Devang Patel bea581d70c It is not possible to determie dominance between two PHI nodes
based on their ordering.

llvm-svn: 35369
2007-03-26 23:18:28 +00:00
Devang Patel 55566a972c Use std::vector<DFCalculateWorkObject> instead of
std::vector<DFCalculateWorkObject *> to reduce malloc/free traffic.

llvm-svn: 35368
2007-03-26 23:17:19 +00:00
Devang Patel eb5d241d00 DominanceFrontier::calculate().
Avoid recursion, Use iterative algorithm.

llvm-svn: 35225
2007-03-20 21:25:31 +00:00
Devang Patel 1758cb50de LoopSimplify::FindPHIToPartitionLoops()
Use ETForest instead of DominatorSet.

llvm-svn: 35221
2007-03-20 20:18:12 +00:00
Bill Wendling 6a462f1e99 Removed iostream #includes. Replaced std::cerr with DOUT.
llvm-svn: 31814
2006-11-17 08:03:48 +00:00
Devang Patel 81c9e42bea remove extra white spaces.
llvm-svn: 30576
2006-09-22 01:07:57 +00:00
Devang Patel 0c4e730c9c Use iterative algorith to assign DFS number. This reduces
call stack depth.

llvm-svn: 30575
2006-09-22 01:05:33 +00:00
Devang Patel 9ce9df5912 Undo previous check-in.
Reintroduce recursive assignDFSNumber().

llvm-svn: 30380
2006-09-14 21:43:24 +00:00
Devang Patel 23d855b40d Avoid recursion in assignDFSNumber(). Move def from ET-Forest.h
to Dominators.h

llvm-svn: 30309
2006-09-14 01:27:42 +00:00
Chris Lattner 3c9b2420df Eliminate RegisterAnalysis. RegisterPass now does all that is necessary.
llvm-svn: 29921
2006-08-27 22:30:17 +00:00
Chris Lattner 38e1a09d4d Add dominates/properlyDominates queries to IDom.
llvm-svn: 29456
2006-08-01 22:24:47 +00:00
Reid Spencer be535661cc 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 5861659a1e 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 6d4a221d80 Fix an et-forest memory leak. Patch by Daniel Berlin.
llvm-svn: 26763
2006-03-14 19:41:45 +00:00
Chris Lattner c020bcf850 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 dfa65542a1 Bugfix for etforest updating. Contributed by Daniel Berlin.
llvm-svn: 25152
2006-01-09 07:58:01 +00:00
Chris Lattner 6c9cbdba1a 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
Duraid Madina c00eab5b03 more HP-UX cleanliness
llvm-svn: 25015
2005-12-26 08:35:06 +00:00
Chris Lattner f519d1c6ef This requires proper dominance
llvm-svn: 24408
2005-11-18 07:27:53 +00:00
Chris Lattner e093c6f565 Make dominates(A,B) work with post dominators. Patch contributed by
Naveen Neelakantam, thanks!

llvm-svn: 21543
2005-04-25 20:50:33 +00:00
Jeff Cohen 82639853c0 Eliminate tabs and trailing spaces
llvm-svn: 21480
2005-04-23 21:38:35 +00:00
Misha Brukman b1c9317bb4 Remove trailing whitespace
llvm-svn: 21427
2005-04-21 23:48:37 +00:00
Reid Spencer 9083936835 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 eb6b8e5772 Make sure any client of Dominators.h links in Dominators.cpp
Patch by Morten Ofstad

llvm-svn: 16987
2004-10-14 15:47:16 +00:00
Reid Spencer 7c16caa336 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
Chris Lattner 39396e2df9 compute dominator tree children in a deterministic order that does not depend
on the address of BasicBlock objects in memory.  This eliminates stuff like this:

 Inorder Dominator Tree:
   [1]  %entry
     [2]  %loopentry
-      [3]  %loopexit
       [3]  %no_exit
-        [4]  %endif
         [4]  %then
+        [4]  %endif
+      [3]  %loopexit
       [3]  %return

llvm-svn: 14253
2004-06-19 20:13:48 +00:00
Chris Lattner 89f803bb32 Print out immediate dominators in program order, not in random order based on the address
of BasicBlock objects

llvm-svn: 14252
2004-06-19 20:04:47 +00:00
Chris Lattner c5e0be647c Add missing #include
llvm-svn: 14037
2004-06-05 00:24:59 +00:00
Chris Lattner d1ea9cd345 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 00f5167693 Completely rewrite domset, idom, and domtree implementation. Now it is based
on the algorithm for directly computing immediate dominators presented in this
paper:

  A Fast Algorithm for Finding Dominators in a Flowgraph
  T. Lengauer & R. Tarjan, ACM TOPLAS July 1979, pgs 121-141.

This _substantially_ speeds up construction of all dominator related information.
Post-dominators to follow.

llvm-svn: 10301
2003-12-07 00:38:08 +00:00