Do global dead code elimination early in optimization.
This gives a 15-20% speedup in compilation time for simple programs (but only ~2% for the big 21k monster program).
This commit is contained in:
2
opt.cpp
2
opt.cpp
@@ -446,6 +446,7 @@ Optimize(llvm::Module *module, int optLevel) {
|
||||
llvm::initializeTarget(*registry);
|
||||
|
||||
bool runSROA = true;
|
||||
optPM.add(llvm::createGlobalDCEPass());
|
||||
|
||||
// Early optimizations to try to reduce the total amount of code to
|
||||
// work with if we can
|
||||
@@ -3906,6 +3907,7 @@ MakeInternalFuncsStaticPass::runOnModule(llvm::Module &module) {
|
||||
"__scatter32_i32", "__scatter32_i64",
|
||||
"__scatter64_i8", "__scatter64_i16",
|
||||
"__scatter64_i32", "__scatter64_i64",
|
||||
"__keep_funcs_live",
|
||||
};
|
||||
|
||||
bool modifiedAny = false;
|
||||
|
||||
Reference in New Issue
Block a user