When a block is tail-duplicated, the PHI nodes from that block are replaced with appropriate COPY instructions. When those PHI nodes contained use operands with subregisters, the subregisters were dropped from the COPY instructions, resulting in incorrect code.
Keep track of the subregister information and use this information when remapping instructions from the duplicated block.
Why do you check for the subreg here?
If you believe the adding constraints will not work, you should check the result of constrainRegClass and act accordingly.