[PATCH] D11691: [WebAssembly] Add Relooper

Jonathan Roelofs jonathan at codesourcery.com
Sun Aug 2 08:07:14 PDT 2015


jroelofs added inline comments.

================
Comment at: lib/Target/WebAssembly/Relooper.cpp:118
@@ +117,3 @@
+    BlockSet Live;
+
+    void FindLive(Block *Root) {
----------------
jfb wrote:
> If it usually stay small then LLVM's `Small*` datastructures can just fit on the stack, and grow to the heap if needed. Nicer than `std::list` because of this. `SmallVector` can be a good fifo, but it's only suited to small things than don't usually grow bigger than your stack allocated quantity.
Oh, sorry, I missed that it needed to be a fifo, and not just a bag of things to work on.

================
Comment at: lib/Target/WebAssembly/Relooper.cpp:138
@@ +137,3 @@
+    // RAII cleanup. Without splitting, we will be forced to introduce labelled
+    // loops to allow
+    // reaching the final block
----------------
weirdly formatted comment block.

================
Comment at: lib/Target/WebAssembly/Relooper.cpp:215
@@ +214,3 @@
+    // Create a list of entries from a block. If LimitTo is provided, only
+    // results in that set
+    // will appear
----------------
weirdly formatted comment block.

================
Comment at: lib/Target/WebAssembly/Relooper.cpp:363
@@ +362,3 @@
+      // If we reach a new block that is already marked as belonging to someone,
+      // it is reachable by
+      // two entries and is not valid for any of them. Remove it and all it can
----------------
weirdly formatted comment block.

================
Comment at: lib/Target/WebAssembly/Relooper.cpp:406
@@ +405,3 @@
+
+      // Having processed all the interesting blocks, we remain with just one
+      // potential issue:
----------------
weirdly formatted comment block.

================
Comment at: lib/Target/WebAssembly/Relooper.cpp:493
@@ +492,3 @@
+    // those are the entries for the
+    //   ->Next block on them, and the blocks are what remains in Blocks (which
+    //   Make* modify). In this way
----------------
weirdly formatted comment block.

================
Comment at: lib/Target/WebAssembly/Relooper.cpp:536
@@ +535,3 @@
+        // through
+        // multiples as opposed to looping since the former is more performant.
+        BlockBlockSetMap IndependentGroups;
----------------
weirdly formatted comment block.

================
Comment at: lib/Target/WebAssembly/Relooper.cpp:572
@@ +571,3 @@
+          // NextEntries. However, must be careful
+          //       there since we create a Next, and that Next can prevent
+          //       eliminating a break (since we no longer
----------------
weirdly formatted comment block.

================
Comment at: lib/Target/WebAssembly/Relooper.cpp:641
@@ +640,3 @@
+    Relooper *Parent;
+    std::stack<Shape *> LoopStack;
+
----------------
thanks!


Repository:
  rL LLVM

http://reviews.llvm.org/D11691







More information about the llvm-commits mailing list