In the case SDNode *CopyFromReg *takes a virtual register and produces its value with type, is this node necessary to be generated for SelectionDAG? I tested some cases that ignores generating CopyFromReg and references the register Node directly also generates good code. Cheers Thomson -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150104/a7620ab2/attachment.html>
Pete Cooper
2015-Jan-04 18:52 UTC
[LLVMdev] Is SDNode CopyFromReg necessary to be generated?
Hi Thomson You'll run into trouble here if the register class of the vreg isn't compatible with that of the instruction generated which reads it. For example, you might have a vreg in an FP register bring read by an integer add. This would require that the CopyFromReg actually generate a cross class register copy to ensure this is valid code. In SD you don't know which actual instruction is going to be generated until late so you won't have the information available to safely remove the copy. It's probably best to just leave it there to avoid any potential issues. Thanks Pete Sent from my iPhone> On Jan 4, 2015, at 1:57 AM, Thomson <lilotom at gmail.com> wrote: > > In the case SDNode CopyFromReg takes a virtual register and produces its value with type, is this node necessary to be generated for SelectionDAG? I tested some cases that ignores generating CopyFromReg and references the register Node directly also generates good code. > > Cheers > Thomson > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150104/f332c0bd/attachment.html>