From f60033e0aaf546d7f56a4925b5aeec76709fb851 Mon Sep 17 00:00:00 2001 From: FICTURE7 Date: Sun, 20 Sep 2020 03:00:24 +0400 Subject: Implement block placement (#1549) * Implement block placement Implement a simple pass which re-orders cold blocks at the end of the list of blocks in the CFG. * Set PPTC version * Use Array.Resize Address gdkchan's feedback --- ARMeilleure/IntermediateRepresentation/BasicBlock.cs | 6 +++++- ARMeilleure/IntermediateRepresentation/BasicBlockFrequency.cs | 8 ++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 ARMeilleure/IntermediateRepresentation/BasicBlockFrequency.cs (limited to 'ARMeilleure/IntermediateRepresentation') diff --git a/ARMeilleure/IntermediateRepresentation/BasicBlock.cs b/ARMeilleure/IntermediateRepresentation/BasicBlock.cs index 640978fe..056a9d46 100644 --- a/ARMeilleure/IntermediateRepresentation/BasicBlock.cs +++ b/ARMeilleure/IntermediateRepresentation/BasicBlock.cs @@ -5,10 +5,12 @@ namespace ARMeilleure.IntermediateRepresentation { class BasicBlock : IIntrusiveListNode { - private readonly List _successors = new List(); + private readonly List _successors; public int Index { get; set; } + public BasicBlockFrequency Frequency { get; set; } + public BasicBlock ListPrevious { get; set; } public BasicBlock ListNext { get; set; } @@ -25,6 +27,8 @@ namespace ARMeilleure.IntermediateRepresentation public BasicBlock(int index) { + _successors = new List(); + Operations = new IntrusiveList(); Predecessors = new List(); DominanceFrontiers = new HashSet(); diff --git a/ARMeilleure/IntermediateRepresentation/BasicBlockFrequency.cs b/ARMeilleure/IntermediateRepresentation/BasicBlockFrequency.cs new file mode 100644 index 00000000..96cfee35 --- /dev/null +++ b/ARMeilleure/IntermediateRepresentation/BasicBlockFrequency.cs @@ -0,0 +1,8 @@ +namespace ARMeilleure.IntermediateRepresentation +{ + enum BasicBlockFrequency + { + Default, + Cold + } +} \ No newline at end of file -- cgit v1.2.3