[LLVMdev] Complex regalloc contraints

Jakob Stoklund Olesen stoklund at 2pi.dk
Wed Sep 8 20:38:18 PDT 2010


On Sep 8, 2010, at 5:16 PM, Lang Hames wrote:

> 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.

Thanks, Lang!

> On Thu, Sep 9, 2010 at 12:21 AM, Jakob Stoklund Olesen <stoklund at 2pi.dk> wrote:
> 
> On Sep 7, 2010, at 6:27 PM, Lang Hames wrote:
> 
>> 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:
>> 
>> struct MyTargetPBQPProblemBuilder : public PBQPProblemBuilder {
>>   PBQP::Graph* buildProblemFor(MachineFunction *mf) {
>>     PBQP::Graph* g = PBQPProblemBuilder::buildProblemFor(mf);
>>     // Add additional constraints for my architecture here.
>>     return g;
>>   }
>> }
>> 
>> Any thoughts or comments? I think this should be a very straightforward extension.
> 
> If a target requires PBQP to work properly, it is going to be registering a new default register allocator constructor.
> 
> It might as well register a function that allocates AND configures PBQP properly then. There is no need for a target hook.
> 
> 
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100908/3630d3f7/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 1929 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100908/3630d3f7/attachment.bin>


More information about the llvm-dev mailing list