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

Matt Arsenault Matthew.Arsenault at amd.com
Tue Jan 27 13:06:54 PST 2015


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



More information about the llvm-dev mailing list