forked from OSchip/llvm-project
MachineScheduler: Ignore COPYs with undef/dead op in CopyConstrain mutation.
There is no problem with the code today, but the fix will avoid a crash in test/CodeGen/AMDGPU/subreg-coalescer-undef-use.ll once the DetectDeadLanes pass is added. llvm-svn: 265351
This commit is contained in:
parent
571e3481e7
commit
7511abd5c1
|
@ -1580,12 +1580,14 @@ void CopyConstrain::constrainLocalCopy(SUnit *CopySU, ScheduleDAGMILive *DAG) {
|
|||
MachineInstr *Copy = CopySU->getInstr();
|
||||
|
||||
// Check for pure vreg copies.
|
||||
unsigned SrcReg = Copy->getOperand(1).getReg();
|
||||
if (!TargetRegisterInfo::isVirtualRegister(SrcReg))
|
||||
const MachineOperand &SrcOp = Copy->getOperand(1);
|
||||
unsigned SrcReg = SrcOp.getReg();
|
||||
if (!TargetRegisterInfo::isVirtualRegister(SrcReg) || !SrcOp.readsReg())
|
||||
return;
|
||||
|
||||
unsigned DstReg = Copy->getOperand(0).getReg();
|
||||
if (!TargetRegisterInfo::isVirtualRegister(DstReg))
|
||||
const MachineOperand &DstOp = Copy->getOperand(0);
|
||||
unsigned DstReg = DstOp.getReg();
|
||||
if (!TargetRegisterInfo::isVirtualRegister(DstReg) || DstOp.isDead())
|
||||
return;
|
||||
|
||||
// Check if either the dest or source is local. If it's live across a back
|
||||
|
|
Loading…
Reference in New Issue