please review - initial putback for implementing functionality for mips16/nomips16 attributes

Reed Kotler rkotler at mips.com
Thu Mar 14 11:16:11 PDT 2013


On 03/14/2013 11:08 AM, Bill Wendling wrote:
> As for whether the method should exist, I'll let Jakob comment.
>
> A few stylistic changes:
>
> You should use:
>
> 	AvailableRegClasses.clear()
>
> instead of:
>
> 	while (!AvailableRegClasses.empty())
> 		AvailableRegClasses.pop_back();
>
> You might also want to do this:
>
> 	memset(RegClassForVT, 0, array_lengthof(RegClassForVT));
>
> -bw

Good points. I'll use clear.

It seems that if you clear the register classes, you can do a

computeRegisterProperties() with impunity after adding new register classes.

That is the main issue between switching back and forth between mips16 and mips32.
The rest is already controlled by predicates in the td files.



>
> On Mar 14, 2013, at 12:39 AM, Reed Kotler <rkotler at mips.com> wrote:
>
>>
>>
>>
>> I added one method which clears the list of register classes.
>>
>> Then there is a change to mips16 code which simulates switching from
>> mips32 to mips16 mode in the same module. It seems to work fine in that
>> I can run this version of llvm for mips16 and it works identical to the
>> one without this code. Beyond the "make check" I have run test-suite
>> against this version.
>>
>> We could just putback the change to include/llvm/Target/TargetLowering.h
>> but by adding the change to
>> lib/Target/Mips/Mips16ISelLowering.cpp
>>   which is a nop for the mips16 compiler, we are able to test that this
>> feature works and that doing things this way allows one to change
>> register sets on a per function basis.
>>
>> The idea here is to add two of the mips32 register sets (including float
>> point which should have a big effect on things) and then
>> computeRegisterProperties() and then revert things to mips16 only
>> registers and call
>> computeRegisterProperties() again.
>>
>> I have several more patches I will need to complete this mips16/nomips16
>> feature but it's easier to do this in pieces.
>>
>> In the end I will remove this testing code from
>> lib/Target/Mips/Mips16ISelLowering.cpp and create a real test case for
>> this. For now this test code shows how this feature can work for other
>> ports like Arm than have a similar need.
>>
>>
>>
>> <mips16_changer.txt>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130314/46761d9e/attachment.html>


More information about the llvm-commits mailing list