<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Sep 8, 2010, at 5:16 PM, Lang Hames wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>That's a good point. I'll factor out the problem builder in the next couple of days and drop a mail to the list explaining how to write extensions.</div></blockquote><div><br></div><div>Thanks, Lang!</div><div><br></div><blockquote type="cite"><div><div>On Thu, Sep 9, 2010 at 12:21 AM, Jakob Stoklund Olesen <span dir="ltr"><<a href="mailto:stoklund@2pi.dk">stoklund@2pi.dk</a>></span> wrote:</div><div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div style="word-wrap:break-word"><div class="im"><br><div><div>On Sep 7, 2010, at 6:27 PM, Lang Hames wrote:</div><br><blockquote type="cite"><span style="border-collapse:separate;font-family:Optima;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;font-size:medium"><div>
The design I have in mind is this: We add a method to TargetRegisterInfo which returns a PBQPProblemBuilder for the target architectures. I implement a base PBQPProblemBuilder by simply lifting the current construction process out of the PBQP allocator and into its own class. Anyone (such as yourself, Carlos) who wants to represent more esoteric constraints in their architecture just extends this class, calls the base class to handle all the basic constraints, then performs their own pass over the function to add in their constraints:</div>
<div><br></div><div><font face="'courier new', monospace">struct MyTargetPBQPProblemBuilder : public PBQPProblemBuilder {</font></div><div><font face="'courier new', monospace"> PBQP::Graph* buildProblemFor(MachineFunction *mf) {</font></div>
<div><font face="'courier new', monospace"> PBQP::Graph* g = PBQPProblemBuilder::buildProblemFor(mf);</font></div><div><font face="'courier new', monospace"> // Add additional constraints for my architecture here.</font></div>
<div><font face="'courier new', monospace"> return g;</font></div><div><font face="'courier new', monospace"> }</font></div><div><font face="'courier new', monospace">}</font></div><div><br></div>
<div>Any thoughts or comments? I think this should be a very straightforward extension.</div></span></blockquote><br></div></div><div>If a target requires PBQP to work properly, it is going to be registering a new default register allocator constructor.</div>
<div><br></div><div>It might as well register a function that allocates AND configures PBQP properly then. There is no need for a target hook.</div><div><br></div><div><br></div></div></blockquote></div><br></div></div>
</blockquote></div><br></body></html>