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

60 Commits

Author SHA1 Message Date
Chandler Carruth
f2e7a23acb Move the old pass manager infrastructure into a legacy namespace and
give the files a legacy prefix in the right directory. Use forwarding
headers in the old locations to paper over the name change for most
clients during the transitional period.

No functionality changed here! This is just clearing some space to
reduce renaming churn later on with a new system.

Even when the new stuff starts to go in, it is going to be hidden behind
a flag and off-by-default as it is still WIP and under development.

This patch is specifically designed so that very little out-of-tree code
has to change. I'm going to work as hard as I can to keep that the case.
Only direct forward declarations of the PassManager class are impacted
by this change.

llvm-svn: 194324
2013-11-09 12:26:54 +00:00
Andrew Trick
e482b777ac Revert "Encapsulate PassManager debug flags to avoid static init and cxa_exit."
Working on a better solution to this.

This reverts commit 7d4e9934e7ca83094c5cf41346966c8350179ff2.

llvm-svn: 190990
2013-09-19 06:02:43 +00:00
Andrew Trick
2a04344d58 Encapsulate PassManager debug flags to avoid static init and cxa_exit.
This puts all the global PassManager debugging flags, like
-print-after-all and -time-passes, behind a managed static. This
eliminates their static initializers and, more importantly, exit-time
destructors.

The only behavioral change I anticipate is that tools need to
initialize the PassManager before parsing the command line in order to
export these options, which makes sense. Tools that already initialize
the standard passes (opt/llc) don't need to do anything new.

llvm-svn: 190974
2013-09-18 23:31:16 +00:00
Filip Pizlo
dd62846c56 This patch breaks up Wrap.h so that it does not have to include all of
the things, and renames it to CBindingWrapping.h.  I also moved 
CBindingWrapping.h into Support/.

This new file just contains the macros for defining different wrap/unwrap 
methods.

The calls to those macros, as well as any custom wrap/unwrap definitions 
(like for array of Values for example), are put into corresponding C++ 
headers.

Doing this required some #include surgery, since some .cpp files relied 
on the fact that including Wrap.h implicitly caused the inclusion of a 
bunch of other things.

This also now means that the C++ headers will include their corresponding 
C API headers; for example Value.h must include llvm-c/Core.h.  I think 
this is harmless, since the C API headers contain just external function 
declarations and some C types, so I don't believe there should be any 
nasty dependency issues here.

llvm-svn: 180881
2013-05-01 20:59:00 +00:00
Pedro Artigas
a84c753671 One more step towards making doInitialization and doFinalization useful for
start up and clean up module passes, now that ASAN and TSAN are fixed the
tests pass

llvm-svn: 168905
2012-11-29 17:47:05 +00:00
Owen Anderson
ef8881a314 Revert r168635 "Step towards implementation of pass manager with doInitialization and doFinalization per module detangled from runOn?? calls, still has temporary code not to break ASAN to be removed when that pass conforms to the proposed model".
It appears to have broken at least one buildbot.

llvm-svn: 168654
2012-11-27 00:53:24 +00:00
Owen Anderson
4f32762479 Step towards implementation of pass manager with doInitialization and doFinalization per module detangled from runOn?? calls, still has temporary code not to break ASAN to be removed when that pass conforms to the proposed model
Patch by Pedro Artigas, with feedback from by Chandler Carruth.

llvm-svn: 168635
2012-11-26 23:54:47 +00:00
Owen Anderson
c7fb54baff Add doInitialization and doFinalization methods to ModulePass's, to allow them to be re-initialized and reused on multiple Module's.
Patch by Pedro Artigas.

llvm-svn: 168008
2012-11-15 00:14:15 +00:00
Andrew Trick
3c9be3c4cc Add pass printer passes in the right place.
The pass pointer should never be referenced after sending it to
schedulePass(), which may delete the pass. To fix this bug I had to
clean up the design leading to more goodness.

You may notice now that any non-analysis pass is printed. So things like loop-simplify and lcssa show up, while target lib, target data, alias analysis do not show up. Normally, analysis don't mutate the IR, but you can now check this by using both -print-after and -print-before. The effects of analysis will now show up in between the two.

The llc path is still in bad shape. But I'll be improving it in my next checkin. Meanwhile, print-machineinstrs still works the same way. With print-before/after, many llc passes that were not printed before now are, some of these should be converted to analysis. A few very important passes, isel and scheduler, are not properly initialized, so not printed.

llvm-svn: 149480
2012-02-01 07:16:20 +00:00
Andrew Trick
fd4f90b0c5 whitespace
llvm-svn: 149479
2012-02-01 07:16:17 +00:00
Dan Gohman
1d48a4b1d7 Tidy some #includes and forward-declarations, and move the C binding code
out of PassManager.cpp and into Core.cpp with the rest of the C binding code.

llvm-svn: 110494
2010-08-07 00:43:20 +00:00
David Greene
dec8f8b802 Fix PR6875:
This includes a patch by Roman Divacky to fix the initial crash.

Move the actual addition of passes from *PassManager::add to
*PassManager::addImpl.  That way, when adding printer passes we won't
recurse infinitely.

Finally, check to make sure that we are actually adding a FunctionPass
to a FunctionPassManager before doing a print before or after it.
Immutable passes are strange in this way because they aren't
FunctionPasses yet they can be and are added to the FunctionPassManager.

llvm-svn: 103425
2010-05-10 20:24:27 +00:00
Jeffrey Yasskin
fb10587e50 Kill ModuleProvider and ghost linkage by inverting the relationship between
Modules and ModuleProviders. Because the "ModuleProvider" simply materializes
GlobalValues now, and doesn't provide modules, it's renamed to
"GVMaterializer". Code that used to need a ModuleProvider to materialize
Functions can now materialize the Functions directly. Functions no longer use a
magic linkage to record that they're materializable; they simply ask the
GVMaterializer.

Because the C ABI must never change, we can't remove LLVMModuleProviderRef or
the functions that refer to it. Instead, because Module now exposes the same
functionality ModuleProvider used to, we store a Module* in any
LLVMModuleProviderRef and translate in the wrapper methods.  The bindings to
other languages still use the ModuleProvider concept.  It would probably be
worth some time to update them to follow the C++ more closely, but I don't
intend to do it.

Fixes http://llvm.org/PR5737 and http://llvm.org/PR5735.

llvm-svn: 94686
2010-01-27 20:34:15 +00:00
Douglas Gregor
16c6819959 Reverting 85714, 85715, 85716, which are breaking the build
llvm-svn: 85717
2009-11-01 16:42:53 +00:00
Dan Gohman
1d0b06c139 Remove the #include of Pass.h from PassManager.h. This breaks a significant
#include dependency, as frontends commonly pull in PassManager.h.

llvm-svn: 85714
2009-11-01 15:20:19 +00:00
Chris Lattner
865a98fba9 allow updating the MPM, so that you can use one FunctionPAssManager with
multiple ModuleProviders, e.g. with the JIT.

llvm-svn: 52796
2008-06-26 22:26:45 +00:00
Dan Gohman
2b0112a65a 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. 

llvm-svn: 48226
2008-03-11 16:41:42 +00:00
Chris Lattner
e0b1ee937a Don't attribute in file headers anymore. See llvmdev for the
discussion of this change.  Boy are my fingers tired. ;-)

llvm-svn: 45411
2007-12-29 19:59:42 +00:00
Chris Lattner
09c4d1b720 remove unimplemented ctor, add some comments.
llvm-svn: 43328
2007-10-25 05:19:24 +00:00
Dan Gohman
b757cdd2e6 Fix pastos in comments for doFinalization functions.
llvm-svn: 40588
2007-07-30 14:51:13 +00:00
Dan Gohman
19d23d8595 Remove forward-declarations for classes that don't exist.
llvm-svn: 36993
2007-05-11 21:05:57 +00:00
Dan Gohman
42a3f4e16e Add the 'explicit' keyword to several constructors that accept one
argument that don't appear intended as implicit-conversion operators.

llvm-svn: 35280
2007-03-23 18:44:11 +00:00
Devang Patel
fcddd83bfc Remove old pass manager.
llvm-svn: 32927
2007-01-05 20:16:23 +00:00
Devang Patel
328930d725 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.

llvm-svn: 32679
2006-12-19 19:46:59 +00:00
Devang Patel
3c8836df17 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

llvm-svn: 32525
2006-12-13 02:36:01 +00:00
Devang Patel
ad1c3bba52 FunctionPassManager does not support runOnModule().
llvm-svn: 32519
2006-12-13 00:34:32 +00:00
Devang Patel
ae0e0cdff7 Implement PassManager_New destructors.
llvm-svn: 32517
2006-12-13 00:09:23 +00:00
Devang Patel
4833df8e9e Implement FunctionPassManager_New::FunctionPassManager_New(ModuleProvider *P)
llvm-svn: 32368
2006-12-08 18:57:16 +00:00
Devang Patel
6060a1e3dc Add run(Function &F) support in FunctionPassManager_New
llvm-svn: 31756
2006-11-15 19:39:54 +00:00
Devang Patel
cb9cd60f59 Add doInitialization and doFinalization support in FunctionManager_New.
llvm-svn: 31747
2006-11-15 02:07:25 +00:00
Devang Patel
785d727d1c Move CommonPassManagerImpl from PassManager.h to PassManager.cpp
llvm-svn: 31666
2006-11-11 01:31:05 +00:00
Devang Patel
124cfa3f26 Keep track if analysis made available by the pass.
llvm-svn: 31664
2006-11-11 01:10:19 +00:00
Devang Patel
1bff0f0174 Keep track of analysis required by the passes. Force use of new pass
manager if a pass does not preserve analysis that is used by other
passes.

llvm-svn: 31659
2006-11-11 00:42:16 +00:00
Devang Patel
a9504181aa s/PassManagerAnalysisHelper/CommonPassManagerImpl
Inherit CommonPassManagerImpl from Pass.

llvm-svn: 31642
2006-11-10 21:33:13 +00:00
Devang Patel
0aa28c8146 Split FunctionPassManager_New into FunctionPassManager_New and FunctionPassManagerImpl_New.
FunctionPassManagerImpl_New implements the pass manager.
FunctionPassManager_New is the public interface.

llvm-svn: 31547
2006-11-08 10:44:40 +00:00
Devang Patel
12982590fa Split PassManager_New into PassManager_New and PassManagerImpl_New.
PassManagerImpl_New implements the pass manager.
PassManager_New is the public interface.

llvm-svn: 31546
2006-11-08 10:29:57 +00:00
Devang Patel
03dc236bdd Move BasicBlockPassManager_New, FunctionPassManager_New and
ModulePassManager_New class declarations from PassManager.h
to PassManager.cpp

llvm-svn: 31545
2006-11-08 10:05:38 +00:00
Devang Patel
d3961139f4 Beautify.
Clarify comments.

llvm-svn: 31529
2006-11-08 00:19:31 +00:00
Devang Patel
283833c127 Derive new pass managers from PassManagerAnalysisHelper.
llvm-svn: 31525
2006-11-07 22:44:55 +00:00
Devang Patel
fece2777c4 Introduce PassManagerAnalysisHelper.
llvm-svn: 31522
2006-11-07 22:35:17 +00:00
Devang Patel
6d4ef98c03 Add PassManager_New.
llvm-svn: 31521
2006-11-07 22:23:34 +00:00
Devang Patel
1082a50ecf Fix comment.
llvm-svn: 31518
2006-11-07 22:04:53 +00:00
Devang Patel
cacc940858 Add ModulePassManager_New.
llvm-svn: 31517
2006-11-07 22:03:15 +00:00
Devang Patel
9a2c6538dd Add FunctionPassManager_New.
llvm-svn: 31515
2006-11-07 21:49:50 +00:00
Devang Patel
b7d2cd5ec2 Add BasicBlockPassManager_New.
llvm-svn: 31513
2006-11-07 21:31:57 +00:00
Chris Lattner
50f76d4c5d Add explicit doInitialization/doFinalization methods instead of making
the FunctionPassManager redo this for each function.

llvm-svn: 30079
2006-09-04 04:07:39 +00:00
Chris Lattner
064e45054a Patch #6's in Saem's refactor-the-passmanager patch series. From him:
This sanitises the world, blows away the specialisations and adds
traits per passmanager type -- seemed most natural.

llvm-svn: 25085
2006-01-04 07:47:13 +00:00
Misha Brukman
3f0aa3dbf8 Remove trailing whitespace
llvm-svn: 21408
2005-04-21 20:19:05 +00:00
Chris Lattner
43c0372c0b 'Pass' should now not be derived from by clients. Instead, they should derive
from ModulePass.  Instead of implementing Pass::run, then should implement
ModulePass::runOnModule.

llvm-svn: 16436
2004-09-20 04:48:05 +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