[llvm-commits] [llvm] r131665 - /llvm/trunk/include/llvm/Support/StandardPasses.h
Eli Friedman
eli.friedman at gmail.com
Thu May 19 12:14:54 PDT 2011
Author: efriedma
Date: Thu May 19 14:14:54 2011
New Revision: 131665
URL: http://llvm.org/viewvc/llvm-project?rev=131665&view=rev
Log:
Fix up the new StandardPasses to run the same scalarrepl passes as the old one.
Modified:
llvm/trunk/include/llvm/Support/StandardPasses.h
Modified: llvm/trunk/include/llvm/Support/StandardPasses.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/StandardPasses.h?rev=131665&r1=131664&r2=131665&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/StandardPasses.h (original)
+++ llvm/trunk/include/llvm/Support/StandardPasses.h Thu May 19 14:14:54 2011
@@ -62,6 +62,9 @@
/// Passes must be registered with functions that take no arguments, so we have
/// to wrap their existing constructors.
static Pass *createScalarReplAggregatesPass(void) {
+ return llvm::createScalarReplAggregatesPass();
+ }
+ static Pass *createSSAScalarReplAggregatesPass(void) {
return llvm::createScalarReplAggregatesPass(-1, false);
}
static Pass *createDefaultLoopUnswitchPass(void) {
@@ -138,7 +141,10 @@
DEFAULT_MODULE_PASS(ArgumentPromotion, StandardPass::OptimzationFlags(3));
// Start of function pass.
// Break up aggregate allocas, using SSAUpdater.
- DEFAULT_MODULE_PASS(ScalarReplAggregates, 0);
+ StandardPass::RegisterDefaultPass(
+ CreatePassFn(createSSAScalarReplAggregatesPass),
+ &DefaultStandardPasses::ScalarReplAggregatesID, 0,
+ StandardPass::Module, 0);
// Catch trivial redundancies
DEFAULT_MODULE_PASS(EarlyCSE, 0);
// Library Call Optimizations
@@ -164,21 +170,21 @@
DEFAULT_MODULE_PASS(LICM, 0);
// Optimize for size if the optimzation level is 0-2
StandardPass::RegisterDefaultPass(
- PassInfo::NormalCtor_t(createSizeOptimizingLoopUnswitchPass),
+ CreatePassFn(createSizeOptimizingLoopUnswitchPass),
&DefaultStandardPasses::LoopUnswitchID, 0,
StandardPass::Module,
StandardPass::OptimzationFlags(0, 2));
// Optimize for size if the optimzation level is >2, and OptimizeSize is
// set
StandardPass::RegisterDefaultPass(
- PassInfo::NormalCtor_t(createSizeOptimizingLoopUnswitchPass),
+ CreatePassFn(createSizeOptimizingLoopUnswitchPass),
&DefaultStandardPasses::LoopUnswitchID, 0,
StandardPass::Module,
StandardPass::OptimzationFlags(3, 0, StandardPass::OptimizeSize));
// Don't optimize for size if optimisation level is >2 and OptimizeSize
// is not set
StandardPass::RegisterDefaultPass(
- PassInfo::NormalCtor_t(createDefaultLoopUnswitchPass),
+ CreatePassFn(createDefaultLoopUnswitchPass),
&DefaultStandardPasses::LoopUnswitchID, 0,
StandardPass::Module,
StandardPass::OptimzationFlags(3, 0, 0, StandardPass::OptimizeSize));
More information about the llvm-commits
mailing list