ud-chains coming to GLSL compiler near you...blogtesthttp://www.paranormal-entertainment.com/idr/blog/posts/2011-05-03T23:36:04Z-ud-chains_coming_to_GLSL_compiler_near_you/blogtestikiwiki2011-05-16T22:42:10ZWhere's the code?http://www.paranormal-entertainment.com/idr/blog/posts/2011-05-03T23:36:04Z-ud-chains_coming_to_GLSL_compiler_near_you/comment_1_21ca005101779d38c53a9f8891825e5b/IanRomanick2011-05-04T00:22:17Z2011-05-04T00:22:15Z
I guess I forgot to mention, all of this code is living in the <code>ud-chains</code> branch of my personal GIT repo: <code>git://anongit.freedesktop.org/~idr/mesa.git</code>
LLVMhttp://www.paranormal-entertainment.com/idr/blog/posts/2011-05-03T23:36:04Z-ud-chains_coming_to_GLSL_compiler_near_you/comment_4_0027da3e9f65f28f19af59e456b93bbe/Anonymous2011-05-04T20:48:29Z2011-05-04T01:40:48Z
Wasn't there some attempt to leverage LLVM for the GLSL compiler?
dot Graphhttp://www.paranormal-entertainment.com/idr/blog/posts/2011-05-03T23:36:04Z-ud-chains_coming_to_GLSL_compiler_near_you/comment_3_6eeafe1d36cc62e410f0e0976a8207c0/Christoph Brill2011-05-04T20:48:29Z2011-05-04T11:41:48Z
I really like the idea of dumping as dot file. This really helps me understanding the data flow
Help wanted ?http://www.paranormal-entertainment.com/idr/blog/posts/2011-05-03T23:36:04Z-ud-chains_coming_to_GLSL_compiler_near_you/comment_5_ebeb21296498c9a7a8354bb62127815f/Anonymous2011-05-04T20:48:29Z2011-05-04T17:37:49Z
This stuff really looks interesting. Do you need any help on the GLSL compiler ? Have a TODO-list somewhere ?
ssa?http://www.paranormal-entertainment.com/idr/blog/posts/2011-05-03T23:36:04Z-ud-chains_coming_to_GLSL_compiler_near_you/comment_2_1980c2a9c12c690c8efc8951883e36c2/Alexander Larsson2011-05-04T19:21:10Z2011-05-04T19:21:09Z
UD chains? Isn't that kinda old? Shouldn't you be using SSA form instead?
RE: ssa?http://www.paranormal-entertainment.com/idr/blog/posts/2011-05-03T23:36:04Z-ud-chains_coming_to_GLSL_compiler_near_you/comment_6_8570f46670cb00a06d5a39bfc1e8916a/IanRomanick2011-05-04T21:22:53Z2011-05-04T21:22:52Z
SSA and ud-chains solve different sets of problems. As far as I'm aware, "real" compilers tend to have both. I know that ICC has both. <em>shrug</em>
RE: Help wanted ?http://www.paranormal-entertainment.com/idr/blog/posts/2011-05-03T23:36:04Z-ud-chains_coming_to_GLSL_compiler_near_you/comment_7_bd588a0759e449033ede83c6820b3ad6/IanRomanick2011-05-04T21:42:15Z2011-05-04T21:42:14Z
We'd love some help, but I don't think we have a good todo list. I know that we want to have a simple intra-block CSE. For inter-block CSE, we'll eventually want SSA (as another poster pointed out). There is a high-level <a href="http://dri.freedesktop.org/wiki/MissingFunctionality">"missing feature" list</a>, but I don't think that gives any guidance for where to start working on stuff.
ssahttp://www.paranormal-entertainment.com/idr/blog/posts/2011-05-03T23:36:04Z-ud-chains_coming_to_GLSL_compiler_near_you/comment_8_5376758c04ba1a553ce238c65fafd387/Alexander Larsson2011-05-05T07:03:51Z2011-05-05T07:03:49Z
<p>I think compilers only support both if they predate ssa and have old optimization steps that use the ud chains. ssa is not an optimization itself but rather a special form of the intermediate language where each variable is only assigned once. In such a form ud chains are trivial, def is at an assignment and use is any op that references that variable name.</p>
<p>My compiler theory is a bit rusty, but I'm fairly sure about this.</p>
ssahttp://www.paranormal-entertainment.com/idr/blog/posts/2011-05-03T23:36:04Z-ud-chains_coming_to_GLSL_compiler_near_you/comment_9_98f79f1ca69397440e0577c4920a73aa/Alexander Larsson2011-05-05T07:53:30Z2011-05-05T07:53:29Z
<p>I guess what I'm saying is, please don't add ud-chains and optimization passed based on it before implementing SSA, as then you'll have to rewrite those optimization passes when you switch to ssa form (and the implementation of the optimization passes are generally simpler when using ssa form).</p>
<p>Here is a book about SSA i found on google: http://ssabook.gforge.inria.fr/latest/book.pdf
At least read some of it before deciding on using ud-chains.</p>
UD chains with vectorshttp://www.paranormal-entertainment.com/idr/blog/posts/2011-05-03T23:36:04Z-ud-chains_coming_to_GLSL_compiler_near_you/comment_10_992fc00bb9e72b5be9e6278e2ec01712/Bryan Cain2011-05-06T00:01:56Z2011-05-06T00:01:54Z
Just curious, how does your implementation of UD chains handle vector variables? Does access to any component(s) count as accessing the entire variable, or does it work per-component?
RE: UD chains with vectorshttp://www.paranormal-entertainment.com/idr/blog/posts/2011-05-03T23:36:04Z-ud-chains_coming_to_GLSL_compiler_near_you/comment_11_c35c9209c2e8b62a088a7d3acb75b72f/IanRomanick2011-05-06T20:23:46Z2011-05-06T20:23:44Z
Vectors will definitely be per-component. Since matrices are (almost always) decomposed into vectors, this will cover them too. Initially structures and arrays will be for the whole variable. The ultimate goal is for this to be generic enough to be re-used with the lower-level IRs. This will allow us to fix some of the issues with the register allocator.
It's fun watchinghttp://www.paranormal-entertainment.com/idr/blog/posts/2011-05-03T23:36:04Z-ud-chains_coming_to_GLSL_compiler_near_you/comment_12_8c38f326887686454bf5690c424d4c92/robert2011-05-16T22:42:10Z2011-05-16T22:42:09Z
people reimplementing LLVM from scratch.