aboutsummaryrefslogtreecommitdiff
path: root/ARMeilleure/CodeGen/X86/CodeGenerator.cs
diff options
context:
space:
mode:
Diffstat (limited to 'ARMeilleure/CodeGen/X86/CodeGenerator.cs')
-rw-r--r--ARMeilleure/CodeGen/X86/CodeGenerator.cs16
1 files changed, 9 insertions, 7 deletions
diff --git a/ARMeilleure/CodeGen/X86/CodeGenerator.cs b/ARMeilleure/CodeGen/X86/CodeGenerator.cs
index 924c113c..ba2df802 100644
--- a/ARMeilleure/CodeGen/X86/CodeGenerator.cs
+++ b/ARMeilleure/CodeGen/X86/CodeGenerator.cs
@@ -97,16 +97,18 @@ namespace ARMeilleure.CodeGen.X86
Logger.StartPass(PassName.Optimization);
- if ((cctx.Options & CompilerOptions.SsaForm) != 0 &&
- (cctx.Options & CompilerOptions.Optimize) != 0)
+ if (cctx.Options.HasFlag(CompilerOptions.Optimize))
{
- Optimizer.RunPass(cfg);
+ if (cctx.Options.HasFlag(CompilerOptions.SsaForm))
+ {
+ Optimizer.RunPass(cfg);
+ }
+
+ BlockPlacement.RunPass(cfg);
}
X86Optimizer.RunPass(cfg);
- BlockPlacement.RunPass(cfg);
-
Logger.EndPass(PassName.Optimization, cfg);
Logger.StartPass(PassName.PreAllocation);
@@ -119,14 +121,14 @@ namespace ARMeilleure.CodeGen.X86
Logger.StartPass(PassName.RegisterAllocation);
- if ((cctx.Options & CompilerOptions.SsaForm) != 0)
+ if (cctx.Options.HasFlag(CompilerOptions.SsaForm))
{
Ssa.Deconstruct(cfg);
}
IRegisterAllocator regAlloc;
- if ((cctx.Options & CompilerOptions.Lsra) != 0)
+ if (cctx.Options.HasFlag(CompilerOptions.Lsra))
{
regAlloc = new LinearScanAllocator();
}