Skip to content

Commit

Permalink
- WIP (renames)
Browse files Browse the repository at this point in the history
  • Loading branch information
tgiphil committed Nov 15, 2023
1 parent 99cf545 commit ef10dbb
Show file tree
Hide file tree
Showing 19 changed files with 72 additions and 39 deletions.
2 changes: 1 addition & 1 deletion Source/Data/X86-Optimizations-IRTransform.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"Name": "Add32",
"SubName": "ToLea32Constant",
"Expression": "IR.Add32 a b",
"Filter": "IsConstant(b)",
"Filter": "IsResolvedConstant(b)",
"Result": "(X86.Lea32 a 0 1 b)",
"Priority": "45",
"Variations": "Yes",
Expand Down
6 changes: 3 additions & 3 deletions Source/Mosa.Compiler.ARM32/Architecture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -142,15 +142,15 @@ public override void ExtendMethodCompilerPipeline(Pipeline<BaseMethodCompilerSta
pipeline.InsertAfterLast<PlatformIntrinsicStage>(
new BaseMethodCompilerStage[]
{
new IRTransformationStage(),
new IRTransformStage(),
mosaSettings.PlatformOptimizations ? new Stages.OptimizationStage() : null,
new PlatformTransformationStage(),
new PlatformTransformStage(),
});

pipeline.InsertBefore<CodeGenerationStage>(
new BaseMethodCompilerStage[]
{
new PlatformTransformationStage(),
new PlatformTransformStage(),
mosaSettings.PlatformOptimizations ? new Stages.OptimizationStage() : null,
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ namespace Mosa.Compiler.ARM32.Stages;
/// ARM32 IR Transformation Stage
/// </summary>
/// <seealso cref="Mosa.Compiler.Framework.Stages.BaseTransformStage" />
public sealed class IRTransformationStage : Compiler.Framework.Stages.BaseTransformStage
public sealed class IRTransformStage : Compiler.Framework.Stages.BaseTransformStage
{
public override string Name => "ARM32." + GetType().Name;

public IRTransformationStage()
public IRTransformStage()
: base()
{
AddTranforms(IRTransforms.List);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ namespace Mosa.Compiler.ARM32.Stages;
/// Platform Transformation Stage
/// </summary>
/// <seealso cref="Mosa.Compiler.Framework.Stages.BaseTransformStage" />
public sealed class PlatformTransformationStage : Compiler.Framework.Stages.BaseTransformStage
public sealed class PlatformTransformStage : Compiler.Framework.Stages.BaseTransformStage
{
public override string Name => "ARM32." + GetType().Name;

public PlatformTransformationStage()
public PlatformTransformStage()
: base(0)
{
AddTranforms(TweakTransforms.List);
Expand Down
6 changes: 3 additions & 3 deletions Source/Mosa.Compiler.ARM64/Architecture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -142,15 +142,15 @@ public override void ExtendMethodCompilerPipeline(Pipeline<BaseMethodCompilerSta
pipeline.InsertAfterLast<PlatformIntrinsicStage>(
new BaseMethodCompilerStage[]
{
new IRTransformationStage(),
new IRTransformStage(),
mosaSettings.PlatformOptimizations ? new Stages.OptimizationStage() : null,
new PlatformTransformationStage(),
new PlatformTransformStage(),
});

pipeline.InsertBefore<CodeGenerationStage>(
new BaseMethodCompilerStage[]
{
new PlatformTransformationStage(),
new PlatformTransformStage(),
mosaSettings.PlatformOptimizations ? new Stages.OptimizationStage() : null,
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ namespace Mosa.Compiler.ARM64.Stages;
/// ARM64 IR Transformation Stage
/// </summary>
/// <seealso cref="Mosa.Compiler.Framework.Stages.BaseTransformStage" />
public sealed class IRTransformationStage : Compiler.Framework.Stages.BaseTransformStage
public sealed class IRTransformStage : Compiler.Framework.Stages.BaseTransformStage
{
public override string Name => "ARM64." + GetType().Name;

public IRTransformationStage()
public IRTransformStage()
: base()
{
//AddTranforms(IRTransforms.List);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ namespace Mosa.Compiler.ARM64.Stages;
/// Platform Transformation Stage
/// </summary>
/// <seealso cref="Mosa.Compiler.Framework.Stages.BaseTransformStage" />
public sealed class PlatformTransformationStage : Compiler.Framework.Stages.BaseTransformStage
public sealed class PlatformTransformStage : Compiler.Framework.Stages.BaseTransformStage
{
public override string Name => "ARM64." + GetType().Name;

public PlatformTransformationStage()
public PlatformTransformStage()
: base(0)
{
AddTranforms(TweakTransforms.List);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
namespace Mosa.Compiler.Framework.Transforms.Optimizations.Auto;

/// <summary>
/// Transformations
/// AutoTransforms
/// </summary>
public static class AutoTransforms
{
Expand Down
6 changes: 3 additions & 3 deletions Source/Mosa.Compiler.x64/Architecture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -163,15 +163,15 @@ public override void ExtendMethodCompilerPipeline(Pipeline<BaseMethodCompilerSta
pipeline.InsertAfterLast<PlatformIntrinsicStage>(
new BaseMethodCompilerStage[]
{
new IRTransformationStage(),
new IRTransformStage(),
mosaSettings.PlatformOptimizations ? new Stages.OptimizationStage() : null,
new PlatformTransformationStage(),
new PlatformTransformStage(),
});

pipeline.InsertBefore<CodeGenerationStage>(
new BaseMethodCompilerStage[]
{
new PlatformTransformationStage(),
new PlatformTransformStage(),
mosaSettings.PlatformOptimizations ? new Stages.OptimizationStage() : null,
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
namespace Mosa.Compiler.x64.Stages;

/// <summary>
/// x64 IR Transformation Stage
/// x64 IR Transform Stage
/// </summary>
/// <seealso cref="Mosa.Compiler.Framework.Stages.BaseTransformStage" />
public sealed class IRTransformationStage : Compiler.Framework.Stages.BaseTransformStage
public sealed class IRTransformStage : Compiler.Framework.Stages.BaseTransformStage
{
public override string Name => "x64." + GetType().Name;

public IRTransformationStage()
public IRTransformStage()
: base()
{
AddTranforms(IRTransforms.List);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
namespace Mosa.Compiler.x64.Stages;

/// <summary>
/// Platform Transformation Stage
/// Platform Transform Stage
/// </summary>
/// <seealso cref="Mosa.Compiler.Framework.Stages.BaseTransformStage" />
public sealed class PlatformTransformationStage : Compiler.Framework.Stages.BaseTransformStage
public sealed class PlatformTransformStage : Compiler.Framework.Stages.BaseTransformStage
{
public override string Name => "x64." + GetType().Name;

public PlatformTransformationStage()
public PlatformTransformStage()
: base(0)
{
AddTranforms(TweakTransforms.List);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
namespace Mosa.Compiler.x64.Transforms.Optimizations.Auto;

/// <summary>
/// Transformations
/// AutoTransforms
/// </summary>
public static class AutoTransforms
{
Expand Down
5 changes: 3 additions & 2 deletions Source/Mosa.Compiler.x86/Architecture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -143,15 +143,16 @@ public override void ExtendMethodCompilerPipeline(Pipeline<BaseMethodCompilerSta
pipeline.InsertAfterLast<PlatformIntrinsicStage>(
new BaseMethodCompilerStage[]
{
//new AdvanceIRTransformStage(),
new IRTransformationStage(),
mosaSettings.PlatformOptimizations ? new Stages.OptimizationStage() : null,
new PlatformTransformationStage(),
new PlatformTransformStage(),
});

pipeline.InsertBefore<CodeGenerationStage>(
new BaseMethodCompilerStage[]
{
new PlatformTransformationStage(),
new PlatformTransformStage(),
mosaSettings.PlatformOptimizations ? new Stages.OptimizationStage() : null,
});

Expand Down
21 changes: 21 additions & 0 deletions Source/Mosa.Compiler.x86/Stages/AdvanceIRTransformStage.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// Copyright (c) MOSA Project. Licensed under the New BSD License.

using Mosa.Compiler.Framework.Transforms.Optimizations.Manual.Special;

namespace Mosa.Compiler.x86.Stages;

/// <summary>
/// X86 Advance IR Transformation Stage
/// </summary>
/// <seealso cref="Mosa.Compiler.Framework.Stages.BaseTransformStage" />
public sealed class AdvanceIRTransformStage : Framework.Stages.BaseTransformStage
{
public override string Name => "x86." + GetType().Name;

public AdvanceIRTransformStage()
: base()
{
//AddTranforms(Transforms.BaseIR.Auto.AutoTransforms.List);
AddTranform(new Deadcode());
}
}
2 changes: 1 addition & 1 deletion Source/Mosa.Compiler.x86/Stages/IRTransformationStage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
namespace Mosa.Compiler.x86.Stages;

/// <summary>
/// X86 IR Transformation Stage
/// X86 IR Transform Stage
/// </summary>
/// <seealso cref="Mosa.Compiler.Framework.Stages.BaseTransformStage" />
public sealed class IRTransformationStage : Framework.Stages.BaseTransformStage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
namespace Mosa.Compiler.x86.Stages;

/// <summary>
/// Platform Transformation Stage
/// Platform Transform Stage
/// </summary>
/// <seealso cref="Mosa.Compiler.Framework.Stages.BaseTransformStage" />
public sealed class PlatformTransformationStage : Framework.Stages.BaseTransformStage
public sealed class PlatformTransformStage : Framework.Stages.BaseTransformStage
{
public override string Name => "x86." + GetType().Name;

public PlatformTransformationStage()
public PlatformTransformStage()
: base(0)
{
AddTranforms(TweakTransforms.List);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
namespace Mosa.Compiler.x86.Transforms.Optimizations.Auto;

/// <summary>
/// Transformations
/// AutoTransforms
/// </summary>
public static class AutoTransforms
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ protected override void Body()
Lines.AppendLine($"namespace {Namespace};");
Lines.AppendLine();
Lines.AppendLine("/// <summary>");
Lines.AppendLine("/// Transformations");
Lines.AppendLine($"/// {Classname}");
Lines.AppendLine("/// </summary>");
Lines.AppendLine($"public static class {Classname}");
Lines.AppendLine("{");
Expand Down
21 changes: 16 additions & 5 deletions Source/Mosa.Utility.SourceCodeGenerator/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -166,11 +166,11 @@ public static void Main()
"Mosa.Compiler.x86.Transforms.Optimizations.Auto")
.Execute();

//new BuildTransformations(
// Path.Combine(dataPath, @"X86-Optimizations-IRTransform.json"),
// Path.Combine(targetPath, @"Mosa.Compiler.x86\Transforms\BaseIR\Auto"),
// "Mosa.Compiler.x86.Transforms")
// .Execute();
new BuildTransformations(
Path.Combine(dataPath, @"X86-Optimizations-IRTransform.json"),
Path.Combine(targetPath, @"Mosa.Compiler.x86\Transforms\BaseIR\Auto"),
"Mosa.Compiler.x86.Transforms.BaseIR.Auto")
.Execute();

new BuildTransformationListFile(
Path.Combine(targetPath, @"Mosa.Compiler.x86\Transforms\Optimizations\Auto"),
Expand All @@ -183,6 +183,17 @@ public static void Main()
})
.Execute();

//new BuildTransformationListFile(
// Path.Combine(targetPath, @"Mosa.Compiler.x86\Transforms\BaseIR\Auto"),
// "AutoTransforms.cs",
// "Mosa.Compiler.x86.Transforms.BaseIR.Auto",
// "AutoTransforms",
// new List<string>
// {
// "Mosa.Compiler.x86.Transforms.BaseIR.Auto"
// })
// .Execute();

// X64

new BuildInstructionList(
Expand Down

0 comments on commit ef10dbb

Please sign in to comment.