{"action":"created","issue":{"url":"https://api.github.com/repos/numba/llvmlite/issues/429","repository_url":"https://api.github.com/repos/numba/llvmlite","labels_url":"https://api.github.com/repos/numba/llvmlite/issues/429/labels{/name}","comments_url":"https://api.github.com/repos/numba/llvmlite/issues/429/comments","events_url":"https://api.github.com/repos/numba/llvmlite/issues/429/events","html_url":"https://github.com/numba/llvmlite/pull/429","id":387188088,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM1NzMxNDIw","number":429,"title":"Allow linking custom LLVM optimization passes","user":{"login":"alendit","id":81117,"node_id":"MDQ6VXNlcjgxMTE3","avatar_url":"https://avatars1.githubusercontent.com/u/81117?v=4","gravatar_id":"","url":"https://api.github.com/users/alendit","html_url":"https://github.com/alendit","followers_url":"https://api.github.com/users/alendit/followers","following_url":"https://api.github.com/users/alendit/following{/other_user}","gists_url":"https://api.github.com/users/alendit/gists{/gist_id}","starred_url":"https://api.github.com/users/alendit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alendit/subscriptions","organizations_url":"https://api.github.com/users/alendit/orgs","repos_url":"https://api.github.com/users/alendit/repos","events_url":"https://api.github.com/users/alendit/events{/privacy}","received_events_url":"https://api.github.com/users/alendit/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-12-04T09:17:19Z","updated_at":"2018-12-10T13:41:13Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/numba/llvmlite/pulls/429","html_url":"https://github.com/numba/llvmlite/pull/429","diff_url":"https://github.com/numba/llvmlite/pull/429.diff","patch_url":"https://github.com/numba/llvmlite/pull/429.patch"},"body":"This PR is related to the dicussion in https://github.com/numba/numba/pull/3531, concretely to the fact that numba can't optimize ref counting across block borders right now. The underlying reason is the split between C++/Python module representation and inability to easily convert from C++ to Python. As a consequence the only reasonable way to implement complex optimization passes is to write a pass in C++ and execute it using `llvmlite`. \r\n\r\nThis PR adds following things:\r\n\r\n* An example `hello` pass, pretty much a copy of the one in LLVM source code. It acts as the basic test case and as an example for the developers who wish to implement an own pass.\r\n\r\n* Adjust exported symbols in `libllvmlite.so` by including the symbols from `libLLVMCore`. This along with using `RTLD_GLOBAL` is required to subsequently load the DSO containing passes. Unfortunatelly it increases the size of `libllvmlite.so` by around ~~5%~~ 2% from 53MB to ~~56MB~~ 54MB on my machine. Any suggestions how to do it more efficiently are, of course, welcome.\r\n\r\n* Extend PassManager interface with ~~`load_shared_lib`~~, `list_registered_passes` and `add_pass_by_arg`. `arg` is used in LLVM context to refer to the unique pass identifier, as opposed to `name` which is its human-readable form. I chose to keep this distinction, but we can adjust it.\r\n\r\n* Add method `load_pass_plugin` to `llvmlite.bindings` which takes a path to a shared library and loads it in the address space.\r\n\r\nThis PR is the prerequisite to another planed extension which would enhance `remove_redundant_nrt_refct` to work across basic blocks."},"comment":{"url":"https://api.github.com/repos/numba/llvmlite/issues/comments/445818656","html_url":"https://github.com/numba/llvmlite/pull/429#issuecomment-445818656","issue_url":"https://api.github.com/repos/numba/llvmlite/issues/429","id":445818656,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0NTgxODY1Ng==","user":{"login":"alendit","id":81117,"node_id":"MDQ6VXNlcjgxMTE3","avatar_url":"https://avatars1.githubusercontent.com/u/81117?v=4","gravatar_id":"","url":"https://api.github.com/users/alendit","html_url":"https://github.com/alendit","followers_url":"https://api.github.com/users/alendit/followers","following_url":"https://api.github.com/users/alendit/following{/other_user}","gists_url":"https://api.github.com/users/alendit/gists{/gist_id}","starred_url":"https://api.github.com/users/alendit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alendit/subscriptions","organizations_url":"https://api.github.com/users/alendit/orgs","repos_url":"https://api.github.com/users/alendit/repos","events_url":"https://api.github.com/users/alendit/events{/privacy}","received_events_url":"https://api.github.com/users/alendit/received_events","type":"User","site_admin":false},"created_at":"2018-12-10T13:41:13Z","updated_at":"2018-12-10T13:41:13Z","author_association":"CONTRIBUTOR","body":"Ok, I think I got it for osx, but Windows being Window is wholly another matter. `Apparently it doesn't support weak dynamic linking`(http://lists.llvm.org/pipermail/llvm-dev/2015-November/091960.html) which makes the whole approach hard if not impossible. I'll have to think about it."}}
{"actor":{"display_login":"alendit"}}