[LLVMdev] Making a CopyToReg/CopyFromReg into a zext/sext?

Ryan Taylor ryta1203 at gmail.com
Tue Jan 27 13:23:17 PST 2015


Ok, thanks. Interchangeably makes sense, I'm not quite clear on the
distinction. If I had a move class and MI for those registers in the
InstrInfo.td file then it matches the MI based on the register classes of
input, output. That doesn't help me with sign.

 So, can you point me in the general direction of where I should be looking
to fix this? I thought they had a similar issue with the R600 trying to
copy between different register types and they put in an explicit hook in
ISelDAGToDAG?

Thanks.

On Tue, Jan 27, 2015 at 4:17 PM, Matt Arsenault <Matthew.Arsenault at amd.com>
wrote:

>  On 01/27/2015 01:15 PM, Ryan Taylor wrote:
>
> So you don't think it's the CopyToReg, it's the CopyFromReg potentially.
> If that's the case it's still somewhat of the same issue right? I still
> need an ext instead of the Copy Node.
>
> I use them interchangeably. It depends on where it's coming from. If the
> size is changing and the move doesn't implicitly extend, then the copy is
> probably wrong and should copy to the same sized register and then create
> the extension.
>
>
> On Tue, Jan 27, 2015 at 4:06 PM, Matt Arsenault <Matthew.Arsenault at amd.com
> > wrote:
>
>> On 01/27/2015 12:50 PM, Ryan Taylor wrote:
>>
>>> I have a CopyToReg that is moving a 16bit reg to a 32bit reg, it's
>>> currently being mapped out as a simple mov (not an ext), I would like to
>>> change that to an ext. It seemed that the SelDAG was the easiest and
>>> cleanest way to do this.
>>>
>>> I can change the mov to an extension MI in the .td file; however, I
>>> can't tell at that point whether it's a sext or a zext, so it seemed the
>>> SelDAG was the better place to fix this.
>>>
>>>  I guess that depends on where the CopyFromReg is coming from. If you
>> need an ext instruction for the copy, it sounds like the CopyFromReg that
>> makes this copy is a bug in the first place.
>>
>> -Matt
>>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150127/9ab31e00/attachment.html>


More information about the llvm-dev mailing list