Commit Graph

311 Commits

Author SHA1 Message Date
Duncan Sands
1465d61bdd Rename getAnalysisToUpdate to getAnalysisIfAvailable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63198 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-28 13:14:17 +00:00
Dan Gohman
e187726208 Fix a use of an invalid iterator when -debug-pass=Details is used.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58816 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-06 21:57:17 +00:00
Nuno Lopes
641397f2ef fix memory leak in pass manager when adding an analysis pass that already existed. as pass manager takes ownership of the added passes, it has to delete the pass if it isnt added to the pass list
tweak the opt tool so that it doesnt access a Pass after the ownership was taken by the pass manager

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58730 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-04 23:03:58 +00:00
Duncan Sands
4520dd2b7b Add <cstdio> include where needed by gcc-4.4.
Patch by Samuel Tardieu.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57291 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-08 07:23:46 +00:00
Devang Patel
617fddf51c Remove interfaces implemented by dead pass from the list of available passes.
Patch By Matthijs Kooijman.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57202 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-06 20:36:36 +00:00
Devang Patel
bd6dc7a086 Add assertion check.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56016 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-09 21:38:40 +00:00
Devang Patel
0938f74242 Simplify.
Fix outdated comment.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55993 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-09 17:56:50 +00:00
Dan Gohman
ae73dc1448 Tidy up several unbeseeming casts from pointer to intptr_t.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55779 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-04 17:05:41 +00:00
Devang Patel
488dc6732d The pass manager is not able to schedule -loop-deletion -loop-index-split.
The loop-deletion pass does not preserve dom frontier, which is required by
loop-index-split. When the PM checks dom frontier for loop-index-split, it has
already verified that lcssa is availalble. However, new dom frontier forces new
loop pass manager, which does not  have lcssa yet.

The PM should recheck availability of required analysis passes in such cases.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54805 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-14 23:07:48 +00:00
Devang Patel
78766ff67c Use SmallVector instead of std::vector
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54685 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-12 15:44:31 +00:00
Devang Patel
721e59cfb2 Use DenseMap to keep track of last users.
Use inversed map for faster queries.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54662 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-12 00:26:16 +00:00
Devang Patel
3b8a90686a Keep track of analysis usage information for passes. Avoid invoking
getAnalysisUsage() repeatedly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54650 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-11 21:13:39 +00:00
Chris Lattner
0dabb7e8f3 Don't call getAnalysisUsage unless -debug-pass is enabled. This speeds
up the passmgr by avoiding useless work.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54528 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-08 15:14:09 +00:00
Chris Lattner
fc65d38085 Speed up the passmgr by avoiding heap thrashing on vectors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54515 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-08 05:33:04 +00:00
Chris Lattner
e2c5ecd46a Don't verify passes when assertions are disabled.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54446 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-07 07:34:50 +00:00
Dan Gohman
0af8225088 Consistently put quotes around pass names in debugging output.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53268 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-09 00:50:40 +00:00
Devang Patel
f35cfe11ef Disable dom info verifier by default.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52983 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-01 21:36:11 +00:00
Devang Patel
844a3d163b Fix typos in comments.
Thanks for the feedback!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52978 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-01 19:50:56 +00:00
Devang Patel
5b57e720c8 Add dom info verifier.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52967 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-01 17:44:24 +00:00
Devang Patel
8fb6a94b69 Print debug message only if there are dead passes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52052 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-06 17:50:36 +00:00
Evan Cheng
7c9b65207e More pass manager debugging outputs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51930 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-04 09:13:31 +00:00
Devang Patel
c0c33f5e2c "Unable to schedule <A> required by <B>" is more helpful then
"Unable to handle Pass that requires lower level Analysis pass"


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51892 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-03 01:20:02 +00:00
Devang Patel
e62f750784 Add debugging aid.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51891 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-03 01:02:16 +00:00
Dan Gohman
844731a7f1 Clean up the use of static and anonymous namespaces. This turned up
several things that were neither in an anonymous namespace nor static
but not intended to be global.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51017 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-13 00:00:25 +00:00
Devang Patel
bed7e68498 Keep track of analysis information inherited from Module pass manager.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48576 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-20 01:09:53 +00:00
Devang Patel
b9c432fe77 #if 1 .. #endif markers do not add any value.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48560 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-19 22:24:25 +00:00
Devang Patel
c758209153 PassInfo keep tracks whether a pass is an analysis pass or not.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48554 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-19 21:56:59 +00:00
Devang Patel
c7fe32e840 Do not use virtual function to identify an analysis pass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48520 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-19 00:48:41 +00:00
Devang Patel
1cee94f041 Identify Analysis pass.
Do not run analysis pass again if analysis info is still available.
This fixes PR1441.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48476 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-18 00:39:19 +00:00
Gordon Henriksen
d78c0f5a72 C and Objective Caml bindings for PassManagers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48413 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-16 04:20:44 +00:00
Dan Gohman
59ef015c65 Eliminate a few unnecessary uses of dynamic_cast.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48318 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-13 02:08:36 +00:00
Dan Gohman
9769cee9f7 Fix a typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48317 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-13 01:58:48 +00:00
Dan Gohman
5fe6e33ef8 Don't redundantly clear std::vector members in destructors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48316 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-13 01:57:34 +00:00
Dan Gohman
0961ec1afe Change PMTopLevelManager's PassManagers vector element type from
Pass* to PMDataManager*. PMDataManager is more specific than Pass,
so this more accurately describes the objects that are being stored.

This eliminates the need for several dynamic_casts to PMDataManager*.
It does introduce one dynamic_cast though, in dumpPasses(). Give
this one a comment describing why a dynamic_cast is being used.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48315 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-13 01:48:32 +00:00
Dan Gohman
c2f12ab5e5 Change PMStack::push to accept a PMDataManager* instead of
a Pass*. PMDataManager* is what it actually holds, so this
makes it clearer.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48314 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-13 01:21:31 +00:00
Dan Gohman
580b89992f Give PassManager and FunctionPassManager a common base class, with
add(Pass *) as a pure virtual member function. This will allow all
the various addPassesTo* functions in LLVM to avoid hard-coding what
type of PassManager is used. 


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48226 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-11 16:41:42 +00:00
Dan Gohman
b4b28231f7 Fix typos in comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48225 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-11 16:18:48 +00:00
Devang Patel
26c22cfbcd Remove dead code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47700 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-27 23:33:51 +00:00
Devang Patel
1cf47cb217 Add comment explaining what is lower level analysis pass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46658 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-02 01:43:30 +00:00
Dan Gohman
97cf759b82 Fix 80-col violations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46510 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-29 12:09:55 +00:00
Chris Lattner
4ee451de36 Remove attribution from file headers, per discussion on llvmdev.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45418 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-29 20:36:04 +00:00
Dan Gohman
cdf2b3b2f8 Add explicit keywords.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42747 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-08 15:08:41 +00:00
Dan Gohman
2bb7d0647e Fix a using namespace llvm; in a header file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42584 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-03 19:04:09 +00:00
Devang Patel
6b4af744b8 Do not overuse std::string. Pass around char * directly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41001 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-10 18:29:32 +00:00
Chris Lattner
fc23bc799d minor simplifications.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40981 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-10 06:22:25 +00:00
Chris Lattner
417efc897b avoid copying strings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40980 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-10 06:17:04 +00:00
Dan Gohman
209ee187c9 Fix pastos in comments for doFinalization functions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40588 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-30 14:51:13 +00:00
Devang Patel
19fe8f907e Add facility to dump pass manager structure
to make it easier to understand failure.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40567 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-27 20:06:09 +00:00
Devang Patel
edbef38067 Use SmallVector instead of std::vector.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40109 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-20 18:04:54 +00:00
Devang Patel
58e0ef1e90 Verify loop info.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40062 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 18:02:32 +00:00
Devang Patel
9750b5d577 Set up ground work to verify preserved analysis info.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40039 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 05:36:09 +00:00
Devang Patel
b42295df4d Fix memory leak.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@38469 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-09 20:52:39 +00:00
Gabor Greif
a99be51bf5 Here is the bulk of the sanitizing.
Almost all occurrences of "bytecode" in the sources have been eliminated.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37913 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-05 17:07:56 +00:00
Devang Patel
7d97bf1429 Fix quotes in debug messages.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37630 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-18 21:32:29 +00:00
Devang Patel
b3b87708eb If user wants to run instcombine twice, do not block it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37301 91177308-0d34-0410-b5e6-96231b3b80d8
2007-05-23 05:08:52 +00:00
Devang Patel
1997473cf7 Drop 'const'
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36662 91177308-0d34-0410-b5e6-96231b3b80d8
2007-05-03 01:11:54 +00:00
Devang Patel
3e15bf33e0 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36652 91177308-0d34-0410-b5e6-96231b3b80d8
2007-05-02 21:39:20 +00:00
Devang Patel
794fd75c67 Do not use typeinfo to identify pass in pass manager.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36632 91177308-0d34-0410-b5e6-96231b3b80d8
2007-05-01 21:15:47 +00:00
Devang Patel
dfa1ec3bc2 Use toplevel function pass manager as OnTheFly manager.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36481 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-26 17:50:19 +00:00
Devang Patel
6b1df0e863 Proivde getAnalysis<FPAnalysis>(Func) support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36159 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-16 20:56:24 +00:00
Devang Patel
f4bd76a035 Do not assert during analysis implementation initialization.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36158 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-16 20:44:16 +00:00
Devang Patel
693941bb6e Print and delete on the fly pass managers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36157 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-16 20:39:59 +00:00
Devang Patel
0ed8df38c2 Update module pass manager to support module passes that require
function passes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36154 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-16 20:27:05 +00:00
Devang Patel
569a6fd9d5 Give each pass manager chance to manage lower level analysis pass, which is
pass required by one of pass managed by the manager.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36153 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-16 20:12:57 +00:00
Anton Korobeynikov
bed2946a96 Removed tabs everywhere except autogenerated & external files. Add make
target for tabs checking.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36146 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-16 18:10:23 +00:00
Devang Patel
d46825c6a1 Speed Up Pass Manager.
- Check Immutableness before searching PreservedSet.
- Avoid unnecessary traversal while setting Last User.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35028 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-08 19:05:01 +00:00
Devang Patel
7b65dd91c1 Keep track of higher level analysis.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34974 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-06 17:52:53 +00:00
Devang Patel
fe613905b3 Keep track of inherited analysis. For example, if a loop pass does not
preserve dominator info then it should update parent FPPassManager's
available analysis info to reflect this.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34942 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-06 01:55:46 +00:00
Devang Patel
22a1cf9d3a Add preparePassManager() hook. This allows each pass to check whether
current active pass manager is appropriate or not.

A loop pass may consider current LPPassManager in appropraite if loop
pass is not preserving analysis information that is used by other
passes managed by current LPPassManager. In such situation, loop pass
can pop current LPPassManager from the PMStack using this  hook
and use new LPPassManager for itself.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34941 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-06 01:06:16 +00:00
Devang Patel
cf5fb2b614 Current pass manager, not the parent pass manager, assumes the role of
last user when one of the managed pass uses info provided by parent pass
manager.

This was exposed by LPPassManager work.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34936 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-05 22:57:49 +00:00
Devang Patel
7f99761143 Avoid constructing std::strings unless pass debugging is ON.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34933 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-05 20:01:30 +00:00
Devang Patel
55d5ac7b5b Account for time consumed by releaseMemory() properly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34932 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-05 18:20:51 +00:00
Jeff Cohen
ca5183d445 Unbreak VC++ build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34917 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-05 00:00:42 +00:00
Devang Patel
84da80d10b Make getPassManagerType() const.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34669 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-27 15:00:39 +00:00
Chris Lattner
63925c831a temporarily revert Devang's most recent patch, which caused a large
compile-time regression in LLC.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34385 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-17 23:14:24 +00:00
Devang Patel
62b20023eb Use inverted map to speedup collectLastUses().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34364 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-17 03:53:44 +00:00
Devang Patel
f5e28d9dfe Do not drop transferred last uses on the floor.
Use handleLastUserOverflow().


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34006 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-07 19:37:53 +00:00
Devang Patel
90f1ad7bf4 Fix PR1158
Do not insert Analysis pass, if it is already available.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33915 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-05 19:34:17 +00:00
Devang Patel
e27ae7e44e cvs commit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33765 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-01 22:08:25 +00:00
Reid Spencer
5cbf985dcb For PR1136: Rename GlobalVariable::isExternal as isDeclaration to avoid
confusion with external linkage types.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33663 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-30 20:08:39 +00:00
Devang Patel
c874eb54ec - Undo previous check-in (i.e. Do not export TimingInfo class through
PassManagers.h).

- Add StopPassTimer() and StartPassTimer() to expose TimingInfo to
CallGraphPassManager

- Use these two APIs in CalLgraphPassManager to measure timings.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33638 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-29 23:10:37 +00:00
Devang Patel
b05ef6a8eb Move TimingInfo into PassManagers.h so that other libs can use it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33626 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-29 20:06:26 +00:00
Devang Patel
44b0d29802 Update ModulePass::assignPassManager() to take into account Preferred
Pass Manager Type.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33308 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-17 21:19:23 +00:00
Devang Patel
26426949f3 s/PassDebugging_New/PassDebugging/g
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33307 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-17 20:33:36 +00:00
Devang Patel
be1ffc6b8d Update assignPassManager() signature to allow selection of preferred
pass manager type. This allows new FPPassManager to select Call Graph
Pass Manager (if available) as its parent.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33306 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-17 20:30:17 +00:00
Devang Patel
8df87095fc Pass manager may require certain analysis. In such cases, initially
pass manager is last user.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33273 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-16 22:38:10 +00:00
Devang Patel
9d133e150f Undo last check-in.
Remove setupPassManager() and its use.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33270 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-16 21:43:18 +00:00
Devang Patel
531f01f878 Setup pass manager before scheduling required analysis.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33262 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-16 19:46:09 +00:00
Devang Patel
8f3f3d103a Code refactoring.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33245 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-16 02:00:38 +00:00
Devang Patel
66eeb49d8f Remove extra white spaces. Fix comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33244 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-15 23:06:56 +00:00
Devang Patel
3f5ecd7eb5 Do not record last users of Pass Manager.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33243 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-15 20:31:54 +00:00
Devang Patel
e24e0e1244 s/addPassToManager/add/g
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33138 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-12 20:07:16 +00:00
Devang Patel
ab7752c149 Move PMTopLevelManager, PMDataManager and FPPassManger classes into
new PassManagers.h header.

This opens door for implementing CGPassManager in IPA library.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33135 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-12 18:52:44 +00:00
Devang Patel
a0dd987916 Remove dead code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33121 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-12 17:23:48 +00:00
Devang Patel
36bcb82c3f Start using PMStack. Now each pass is responsibe for assinging
a pass manager for itself.

There is some opportunity to remove some dead code from PassManager.cpp.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33087 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-11 22:15:30 +00:00
Devang Patel
6b9420e943 Use getPassManagerType() instead of dynamic_cast.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33078 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-11 19:59:06 +00:00
Devang Patel
25919cb780 Add PassManagerType enum.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33065 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-11 01:10:25 +00:00
Devang Patel
97149737f2 Robustify assingPassManager() for Module, Function and Basic Block
Passes.

Robustify PMStack.push()

Add dump() routine to print PMStack.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33062 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-11 00:19:00 +00:00
Devang Patel
09e6e4303f Add PMStack, a Pass Manager stack.
Eventually, Top level pass managers  will use this to keep track of
active pass managers. Eass pass will also learn how to find appropriate
manager from these managers stack.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33018 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-08 19:29:38 +00:00
Devang Patel
cde53d3c1e 1) Remove old AnalysisResolver.
2) Rename AnalysisResolver_New as AnalysisResolver


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32938 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-05 22:47:07 +00:00
Devang Patel
cccd80dfa3 Remove old pass manager.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32927 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-05 20:16:23 +00:00
Devang Patel
1336a6bf06 At the beginning of run, initialize analyis info availability for _ALL_
pass managers. Otherwise, stale available analysis info, from the managers not
yet run, may cause pass manager to take wrong turn.

This fixes CBE test failures reported by nightly tester.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32726 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-21 00:16:50 +00:00
Devang Patel
a68941b2d4 Now, there is additional layer, referred in the comment,
in place to handle this correctly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32684 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-19 20:12:38 +00:00
Devang Patel
5f4ddf517f s/BasicBlockPassManager/BBPassManager/g
s/ModulePassManager/MPPassManager/g
s/FunctionPassManagerImpl_New/FunctionPassManagerImpl/g
s/PassManagerImpl_New/PassManagerImpl/g

Introduce FPPassManager to manage function passes and
BBPassManagers.

Now FunctionPassManagerImpl is an implementation class
used by externally visible FunctionPassManager to manage
FPPassManagers.

Module pass manager (MPPassManager) now manages FPPassManagers
and ModulePasses.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32679 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-19 19:46:59 +00:00
Devang Patel
1554c85456 Add getNumContainedPasses() and getContainedPass() inteface and use
it instead of passVectorBegin/End().


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32620 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-16 00:56:26 +00:00
Devang Patel
1a8038636c Cosmetic changes, based on Chris's review.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32618 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-15 22:57:49 +00:00
Devang Patel
a52035a062 Mark dump* routines const routines.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32610 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-15 20:13:01 +00:00
Devang Patel
c2ff962bf9 Move PMTopLevelManager and TImingInfo into anon namespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32606 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-15 19:39:30 +00:00
Devang Patel
ef89c5594a s/ForcedLastUses/TransferLastUses/g
Register pass has the its last user, otherwise sometimes no one will claim
LastUse.

Handle transferred last uses from child pass manager.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32589 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-15 00:08:26 +00:00
Chris Lattner
a84b3025ca random minor typographical changes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32579 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-14 18:22:14 +00:00
Devang Patel
8e58a1b17b Add -time-passes support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32574 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-14 00:59:42 +00:00
Devang Patel
017b5d969b Add debug-pass=Details support to print Required and Preserved Set info.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32573 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-14 00:25:06 +00:00
Devang Patel
693a74e4ee Add " Made Modification " messages in debug-pass=Executions output.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32572 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-14 00:08:04 +00:00
Devang Patel
4eeea774ce Add debug-pass=Executions support in new pass manager.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32571 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-13 23:50:44 +00:00
Devang Patel
c32cf54101 Add -pass-debug=Arguments support in new manager.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32567 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-13 22:10:00 +00:00
Chris Lattner
6e9e5e026a fit in 80 cols
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32563 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-13 21:56:10 +00:00
Devang Patel
e8ff1ce734 Using PDL as a prefix for PassDebugLevel enums is not a good idea.
Fix it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32562 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-13 21:13:31 +00:00
Devang Patel
45dc02d6f9 Move enum PassDebugLevel from PassManagerT.h to Pass.h.
Use PDL as the prefix for these enums.
Define and use PassDebugging_New in new PassManager.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32554 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-13 20:03:48 +00:00
Devang Patel
3162691f69 Add #ifdef switch toggle between old and new pass manager. However,
continue to use old pass manager at the moment. To use new manager
remove #define USE_OLD_PASSMANAGER 1 from Pass.h


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32525 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-13 02:36:01 +00:00
Devang Patel
2db3a3bed7 FunctionPassManager does not support runOnModule().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32519 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-13 00:34:32 +00:00
Devang Patel
37a6f7966c Implement PassManager_New destructors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32517 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-13 00:09:23 +00:00
Devang Patel
d4ea4ef541 Remove unused constructor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32516 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-12 23:51:31 +00:00
Devang Patel
ebc0922eeb Add routines to dump pass manager queue.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32513 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-12 23:34:33 +00:00
Devang Patel
b920bd85ad FunctionPassManager()
Set AnalysisResolver_New and add FPM to PassManagers list.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32512 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-12 23:27:37 +00:00
Devang Patel
1fbe2c9964 Do not runOnFunction on external functions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32510 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-12 23:15:28 +00:00
Devang Patel
41545fd663 Initialize AnalysisImpls for each pass before executing the pass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32509 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-12 23:13:09 +00:00
Devang Patel
27aaab2bd3 collectRequiredAnalysisPasses().
Include RequiredTrainsitiveSet also.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32508 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-12 23:09:32 +00:00
Devang Patel
54e247d2d0 removeNotPreservedAnalysis().
Do not remove ImmutablePass from the list.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32507 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-12 23:07:44 +00:00
Devang Patel
395ed73984 Initialize activeManager.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32506 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-12 22:57:43 +00:00
Devang Patel
1e1008a52e Remove unused constructor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32505 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-12 22:56:36 +00:00
Devang Patel
a5f9d556b7 Maintain ImmutablePasses list at top level only. Do not make them
directly available to individual managers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32504 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-12 22:53:40 +00:00
Devang Patel
d0fa16c336 findAnalysisPass().
First search all available passes before searching ImmutablePasses.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32503 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-12 22:50:05 +00:00
Devang Patel
7e601a70fc Fix thinko.
While searching for a analysis in a pass manager, do not search it into
pass manager's manager.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32501 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-12 22:47:13 +00:00
Devang Patel
1b8d015066 o s/OtherPassManagers/IndirectPassManagers
o Make IndirectPassManagers vector of PMDataManager *
o Move PMTopLevelManager implementation below all class declarations.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32499 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-12 22:35:25 +00:00
Devang Patel
689c683bcc Initialize AnalysisImpls for ImmutablePass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32498 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-12 22:21:37 +00:00
Devang Patel
dff33ef8e8 Set top level manager.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32496 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-12 22:02:16 +00:00
Devang Patel
298feadd7a Analysis resolver now manages AnalysisImpls for the given patch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32389 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-09 01:11:34 +00:00
Devang Patel
5b640e7edc Top level pass manager keeps track of other managers, so this can be
removed now.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32388 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-09 00:09:12 +00:00
Devang Patel
cd520b187a Use analysis resolver to find the info.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32387 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-09 00:07:38 +00:00
Devang Patel
c9a6293af7 Do not drop ImmutablePasses on the floor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32386 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-08 23:57:43 +00:00
Devang Patel
145e83dc12 Set AnalysisResolver for the passes when they are inserted into
pass manager queuer.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32385 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-08 23:53:00 +00:00
Devang Patel
f3dc6d9f95 Add AnalysisResolver_New. It is a replacement for existing
AnalysisResolver.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32383 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-08 23:28:54 +00:00
Devang Patel
591b1b7526 Keep track of other pass managers, that are not directly managed by
top level manager. Use this info to findAnalysisPass.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32382 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-08 23:11:43 +00:00
Devang Patel
c475692c5e Implement top level FunctionPassManager::run(Function &F)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32381 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-08 22:57:48 +00:00
Devang Patel
a083e94f79 Do not keep yet another list of pass managers in PassManagerImpl_New.
Use one provided by toplevel manager.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32380 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-08 22:47:25 +00:00
Devang Patel
e61b7478e5 Remove unused schedulePass() parameter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32379 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-08 22:34:02 +00:00
Devang Patel
3279d4c781 Remove unused getAnalysisPass and getAnalysisPassFromManager
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32378 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-08 22:32:32 +00:00
Devang Patel
69867b511c Implement PMTopLevel::findAnalysisPass() and
PMDataManager::findAnalysisPass()


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32377 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-08 22:30:11 +00:00
Devang Patel
4d9a186b10 During runOnModule() do initialization and finalization.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32371 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-08 19:04:09 +00:00
Devang Patel
97856ceeab Reuse code. Directly use runOnFunction().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32370 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-08 19:03:05 +00:00