diff options
Diffstat (limited to 'src/cfg/Relooper.cpp')
-rw-r--r-- | src/cfg/Relooper.cpp | 31 |
1 files changed, 3 insertions, 28 deletions
diff --git a/src/cfg/Relooper.cpp b/src/cfg/Relooper.cpp index 9330be718..dbdaa5507 100644 --- a/src/cfg/Relooper.cpp +++ b/src/cfg/Relooper.cpp @@ -100,7 +100,6 @@ wasm::Expression* Block::Render(RelooperBuilder& Builder, bool InLoop) { } bool SetLabel = true; // in some cases it is clear we can avoid setting label, see later - bool ForceSetLabel = Shape::IsEmulated(Parent) != nullptr; // A setting of the label variable (label = x) is necessary if it can // cause an impact. The main case is where we set label to x, then elsewhere @@ -170,7 +169,7 @@ wasm::Expression* Block::Render(RelooperBuilder& Builder, bool InLoop) { Target = DefaultTarget; Details = ProcessedBranchesOut[DefaultTarget]; } - bool SetCurrLabel = (SetLabel && Target->IsCheckedMultipleEntry) || ForceSetLabel; + bool SetCurrLabel = SetLabel && Target->IsCheckedMultipleEntry; bool HasFusedContent = Fused && contains(Fused->InnerMap, Target->Id); wasm::Expression* CurrContent = nullptr; if (SetCurrLabel || Details->Type != Branch::Direct || HasFusedContent || Details->Code) { @@ -239,7 +238,7 @@ wasm::Expression* Block::Render(RelooperBuilder& Builder, bool InLoop) { CurrName = SwitchDefault; } // generate the content for this block - bool SetCurrLabel = (SetLabel && Target->IsCheckedMultipleEntry) || ForceSetLabel; + bool SetCurrLabel = SetLabel && Target->IsCheckedMultipleEntry; bool HasFusedContent = Fused && contains(Fused->InnerMap, Target->Id); wasm::Expression* CurrContent = nullptr; if (SetCurrLabel || Details->Type != Branch::Direct || HasFusedContent || Details->Code) { @@ -347,15 +346,9 @@ wasm::Expression* LoopShape::Render(RelooperBuilder& Builder, bool InLoop) { return Ret; } -// EmulatedShape - -wasm::Expression* EmulatedShape::Render(RelooperBuilder& Builder, bool InLoop) { - abort(); // TODO -} - // Relooper -Relooper::Relooper() : Root(nullptr), Emulate(false), MinSize(false), BlockIdCounter(1), ShapeIdCounter(0) { // block ID 0 is reserved for clearings +Relooper::Relooper() : Root(nullptr), MinSize(false), BlockIdCounter(1), ShapeIdCounter(0) { // block ID 0 is reserved for clearings } Relooper::~Relooper() { @@ -468,21 +461,6 @@ void Relooper::Calculate(Block *Entry) { return Simple; } - Shape *MakeEmulated(BlockSet &Blocks, Block *Entry, BlockSet &NextEntries) { - PrintDebug("creating emulated block with entry #%d and everything it can reach, %d blocks\n", Entry->Id, Blocks.size()); - EmulatedShape *Emulated = new EmulatedShape; - Notice(Emulated); - Emulated->Entry = Entry; - for (BlockSet::iterator iter = Blocks.begin(); iter != Blocks.end(); iter++) { - Block *Curr = *iter; - Emulated->Blocks.insert(Curr); - Curr->Parent = Emulated; - Solipsize(Curr, Branch::Continue, Emulated, Blocks); - } - Blocks.clear(); - return Emulated; - } - Shape *MakeLoop(BlockSet &Blocks, BlockSet& Entries, BlockSet &NextEntries) { // Find the inner blocks in this loop. Proceed backwards from the entries until // you reach a seen block, collecting as you go. @@ -794,9 +772,6 @@ void Relooper::Calculate(Block *Entry) { if (Entries->size() == 0) return Ret; if (Entries->size() == 1) { Block *Curr = *(Entries->begin()); - if (Parent->Emulate) { - Make(MakeEmulated(Blocks, Curr, *NextEntries)); - } if (Curr->BranchesIn.size() == 0) { // One entry, no looping ==> Simple Make(MakeSimple(Blocks, Curr, *NextEntries)); |