This patch includes logic in the Scheduling phase of Instruction selection to check whether or not a CopyToReg will clobber a physical register's live range. If so, the scheduler will not be able to schedule the instruction in the current cycle with the current partial schedule. Without this, the scheduler can schedule CopyToRegs even if they violate a live range, resulting in correctness bugs.
Hey Stas -- thanks for comments.
The are two theoretical ways Node will be nullptr. 1. We are using default value, 2. The SDNode we passed is actually a nullptr. Neither way creates a problem for this condition.