<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Nov 10, 2007, at 11:07 PM, Christopher Lamb wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; ">I've been playing around with clang/LLVM looking at adding partial support for the draft technical report for embedded C extensions (TR18037, <a href="http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1169.pdf"><font class="Apple-style-span" color="#001FE8">http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1169.pdf</font></a>), specifically named address spaces.<div><br class="khtml-block-placeholder"></div><div>Named address spaces need to be tracked in LLVM in essentially all the same places that alignment is tracked,</div></div></blockquote><br></div><div>Others addressed the other questions, one (surprising?) thing I'd recommend:</div><div><br class="webkit-block-placeholder"></div><div>Unlike alignment and volatility, I think that the address space qualifier should be represented explicitly in the type system.  The reason for this is primarily that pointers to different address spaces are really very different sorts of beasties: for example they can be codegen'd to have different sizes.  Any property that affects how the value is stored in registers needs to be in the type instead of on the load/store instruction.  Also, unlike volatile, it is not common to cast a pointer between two different address spaces. </div><div><br class="webkit-block-placeholder"></div><div>The good thing about this is that I think it will make it substantially easier to update the various llvm optimizations if you do this.  The meat of project boils down to adding a new address space qualifier field to PointerType, making sure PointerType takes this field into account when it is being uniqued, and adding the address space qualifier to things like global variable.</div><div><br class="webkit-block-placeholder"></div><div>Does this sound reasonable?</div><div><br class="webkit-block-placeholder"></div><div>-Chris</div></body></html>