[PATCH] D11691: [WebAssembly] Add Relooper

JF Bastien jfb at chromium.org
Mon Aug 3 12:50:56 PDT 2015


jfb added inline comments.

================
Comment at: lib/Target/WebAssembly/CMakeLists.txt:12
@@ -11,2 +11,3 @@
 add_llvm_target(WebAssemblyCodeGen
+  Relooper.cpp
   WebAssemblyAsmPrinter.cpp
----------------
arsenm wrote:
> Will this pass purely be doing the structurizing, or will it also be responsible for insertion of the higher level control flow instructions? I think one of the many failings of AMDILCFGStructurizer is that it attempts to do both at the same time / in the same pass.
It identifies the structure, but acts like an `AnalysisPass` in that it just passes that info onto later code.

================
Comment at: lib/Target/WebAssembly/Relooper.cpp:83
@@ +82,3 @@
+  // FIXME: move from char* to LLVM data structures
+  free(static_cast<void *>(const_cast<char *>(Code)));
+  free(static_cast<void *>(const_cast<char *>(BranchVar)));
----------------
Yeah I'd like to avoid `shared_ptr` overheads.

It does seem like either `unique_ptr` or a `BumpPtrAllocator` would work though.

================
Comment at: lib/Target/WebAssembly/Relooper.cpp:757
@@ +756,3 @@
+                      } else {
+                        assert(Details->Type == Branch::Direct);
+                        Details->Type = Branch::Nested;
----------------
Fine with me, with a FIXME explaining that.


Repository:
  rL LLVM

http://reviews.llvm.org/D11691







More information about the llvm-commits mailing list