mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-10 18:26:02 +00:00
Fix up the new StandardPasses to run the same scalarrepl passes as the old one.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131665 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -62,6 +62,9 @@ namespace llvm {
|
||||
/// 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 @@ namespace llvm {
|
||||
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 @@ namespace llvm {
|
||||
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));
|
||||
|
Reference in New Issue
Block a user