[LLVMdev] changing register classes on a per function basis

Reed Kotler rkotler at mips.com
Wed Mar 13 11:51:54 PDT 2013

On 03/13/2013 10:58 AM, reed kotler wrote:
> Current ISelDagToDag is created once per module.
> The TargetLowering class is allocated there and register classes are
> added and the computeRegisterProperties is called.
> In order to switch back and forth between mips16 and mips32, I need to
> be able to reset what is done during computerRegisterProperties.
> Has anyone else looked into this for another port?
> Ideas?
> Mips16 is an instruction decoding mode, akin to Thumb 1 and so functions
> of both mips16 and mips32 mode can exist side by side in the same module.
> Tia.
> Reed

Seems, that except for the obvious memory leaking, that merely resetting 
AvailableRegClasses and calling  computerRegisterProperties again  will 
do the trick.

I'll see if this works and then solve the memory leak problem if it does.

I guess I would add a pair of reset functions to TargetLoweringBase.




More information about the llvm-dev mailing list