{"action":"opened","issue":{"url":"https://api.github.com/repos/shader-slang/slang/issues/478","repository_url":"https://api.github.com/repos/shader-slang/slang","labels_url":"https://api.github.com/repos/shader-slang/slang/issues/478/labels{/name}","comments_url":"https://api.github.com/repos/shader-slang/slang/issues/478/comments","events_url":"https://api.github.com/repos/shader-slang/slang/issues/478/events","html_url":"https://github.com/shader-slang/slang/issues/478","id":311707679,"number":478,"title":"IR: add a concrete representation of passes and the analyses they preserve","user":{"login":"tfoleyNV","id":10618364,"avatar_url":"https://avatars2.githubusercontent.com/u/10618364?v=4","gravatar_id":"","url":"https://api.github.com/users/tfoleyNV","html_url":"https://github.com/tfoleyNV","followers_url":"https://api.github.com/users/tfoleyNV/followers","following_url":"https://api.github.com/users/tfoleyNV/following{/other_user}","gists_url":"https://api.github.com/users/tfoleyNV/gists{/gist_id}","starred_url":"https://api.github.com/users/tfoleyNV/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tfoleyNV/subscriptions","organizations_url":"https://api.github.com/users/tfoleyNV/orgs","repos_url":"https://api.github.com/users/tfoleyNV/repos","events_url":"https://api.github.com/users/tfoleyNV/events{/privacy}","received_events_url":"https://api.github.com/users/tfoleyNV/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-04-05T17:48:37Z","updated_at":"2018-04-05T17:48:37Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"The passes we do in the IR right now don't make use of a lot of side-band structures, and most that they do get created on the fly:\r\n\r\n* The \"linking\" step that merges IR from different modules builds a symbol table to map mangled names to the values that provide them. A few other passes use (or need) a representation like this)\r\n\r\n* Lowering and linking rely on a value-numbering map for \"hoistable\" instructions (those that can be CSE'd without any real concerns), and some later passes would benefit from that structure being kept up to date (although right now it is just in the builder)\r\n\r\n* Many of the mandatory optimizations are going to need a dominator tree see\r\n\r\nA reasonable way to handle these kinds of things (which amounts to \"how the LLVM project does it...\") is to have a first-class notion of \"passes\" including \"analyses\" that build up side-band data structures to pair with the IR. Passes have IDs, and meta-data that specifies which analyses they require, which they generate, and which they preserve. The compiler can then run a sequence of passes and make sure to inject extra analysis passes as needed to build or re-build analysis results as required by the main passe to be run.\r\n\r\nFor now we can just hack this by re-building structures as required, even if that might be redundant, but longer-term it makes sense to get a bit more structured."}}
{"actor":{"display_login":"tfoleyNV"}}