binaryen icon indicating copy to clipboard operation
binaryen copied to clipboard

Dynamic loading of custom passes in wasm-opt

Open loganek opened this issue 1 year ago • 1 comments

Hi, I created my own pass that instruments all the malloc/calloc/realloc/free calls in the WASM binary so I can very precisely track the heap memory usage. I don't think my usecase is generic enough to include the pass in the upstream wasm-opt (although I wouldn't mind doing that if maintainers are happy to accept it), so I thought I'll compile it as DSO library and load it dynamically.

I realized that wasm-opt doesn't have an option to dynamically load passes from DSOs; was that functionality ever considered and/or is there a plan to add such feature?

loganek avatar Apr 25 '24 20:04 loganek

We've thought in the past that it would be neat to be able to have pass plugins, but we've never made plans to actually work on such a feature.

FWIW, I think we would be happy to take a pass for tracking memory usage upstream.

tlively avatar Apr 25 '24 21:04 tlively