1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-01-31 20:51:52 +01:00

Add a new pass, run internalize first

llvm-svn: 11839
This commit is contained in:
Chris Lattner 2004-02-25 21:35:13 +00:00
parent 0dfe43a53a
commit 24c4dd56b5

View File

@ -81,6 +81,17 @@ GenerateBytecode (Module *M, bool Strip, bool Internalize, std::ostream *Out) {
addPass(Passes, createFunctionResolvingPass());
if (!DisableOptimizations) {
if (Internalize) {
// Now that composite has been compiled, scan through the module, looking
// for a main function. If main is defined, mark all other functions
// internal.
addPass(Passes, createInternalizePass());
}
// Now that we internalized some globals, see if we can mark any globals as
// being constant!
addPass(Passes, createGlobalConstifierPass());
// Linking modules together can lead to duplicated global constants, only
// keep one copy of each constant...
addPass(Passes, createConstantMergePass());
@ -91,13 +102,6 @@ GenerateBytecode (Module *M, bool Strip, bool Internalize, std::ostream *Out) {
if (Strip)
addPass(Passes, createSymbolStrippingPass());
if (Internalize) {
// Now that composite has been compiled, scan through the module, looking
// for a main function. If main is defined, mark all other functions
// internal.
addPass(Passes, createInternalizePass());
}
// Propagate constants at call sites into the functions they call.
addPass(Passes, createIPConstantPropagationPass());