<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Oct 19, 2009, at 7:28 PM, Lang Hames wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; ">Hi Susan,<div><br></div><div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; ">You may find the PBQP allocator implementation useful as a reference<br>to what's involved in adding a new allocator to LLVM. It's located in<br>lib/CodeGen/RegAllocPBQP.cpp, with supporting files in the lib/CodeGen/<br>PBQP directory.<br></blockquote><div><br></div><div>Yes - as far as working allocators go PBQP is pretty simple. If you're just interested in LLVM API details you can focus on the lower half of the RegAllocPBQP.cpp source file (everything from PBQPRegAlloc::findVRegIntervalsToAlloc()). The rest of the source (class declaration at the top of RegAllocPBQP.cpp aside) is mostly concerned with PBQP algorithm specifics, such as constructing cost matrices, or carrying out the PBQP graph reduction algorithm.</div></div></div></span></blockquote></div><br><div>Other advice: if you're looking to simplify this for students, I'd recommend staying away from X86 or ARM, which use subregs heavily. If you work with (e.g.) the sparc backend, you can avoid them completely, simplifying the problem.</div><div><br></div><div>-Chris</div></body></html>