[PATCH] D11691: [WebAssembly] Add Relooper

Alon Zakai via llvm-commits llvm-commits at lists.llvm.org
Sun Nov 6 09:29:06 PST 2016


kripken added a comment.

In https://reviews.llvm.org/D11691#587616, @hughperkins wrote:

> Hi, I have a project to rewrite llvm code as OpenCL https://github.com/hughperkins/cuda-on-cl  It currently outputs lots of conditional branches, is labels and gotos, in the output .I want to 'reloop' this into fors/whiles/ etc.  To what extent can I use the code in this PR to achieve this?  What are the preferred option(s) for me to use this code from my own code? (eg drop the sourcecod into my repo? build as a shared object somehow?  some other approach?)


The best option is probably to take the Relooper implementation from Binaryen,

https://github.com/WebAssembly/binaryen/tree/master/src/cfg

In LLVM this PR landed but I'm not sure how much it was used or tested, and it seems to have been removed at some point. In Binaryen the Relooper is in active use, heavily tested and fuzzed, and also has a bunch of optimizations and improvements since the LLVM version.

I would just grab the Relooper.h and Relooper.cpp files from Binaryen and use those (might have some minor dependencies on headers that you can grab too). Happy to help with any questions you have in that process.


Repository:
  rL LLVM

https://reviews.llvm.org/D11691





More information about the llvm-commits mailing list