@@ -474,8 +474,7 @@ PPCReduceCRLogicals::createCRLogicalOpInfo(MachineInstr &MIParam) {
474474 } else {
475475 MachineInstr *Def1 = lookThroughCRCopy (MIParam.getOperand (1 ).getReg (),
476476 Ret.SubregDef1 , Ret.CopyDefs .first );
477- if (Ret.SubregDef1 == 0 )
478- Ret.SubregDef1 = MIParam.getOperand (1 ).getSubReg ();
477+ Ret.SubregDef1 = MIParam.getOperand (1 ).getSubReg ();
479478 assert (Def1 && " Must be able to find a definition of operand 1." );
480479 Ret.DefsSingleUse &=
481480 MRI->hasOneNonDBGUse (Def1->getOperand (0 ).getReg ());
@@ -486,8 +485,7 @@ PPCReduceCRLogicals::createCRLogicalOpInfo(MachineInstr &MIParam) {
486485 MachineInstr *Def2 = lookThroughCRCopy (MIParam.getOperand (2 ).getReg (),
487486 Ret.SubregDef2 ,
488487 Ret.CopyDefs .second );
489- if (Ret.SubregDef2 == 0 )
490- Ret.SubregDef2 = MIParam.getOperand (2 ).getSubReg ();
488+ Ret.SubregDef2 = MIParam.getOperand (2 ).getSubReg ();
491489 assert (Def2 && " Must be able to find a definition of operand 2." );
492490 Ret.DefsSingleUse &=
493491 MRI->hasOneNonDBGUse (Def2->getOperand (0 ).getReg ());
@@ -549,8 +547,6 @@ MachineInstr *PPCReduceCRLogicals::lookThroughCRCopy(unsigned Reg,
549547 if (!Copy->isCopy ())
550548 return Copy;
551549 Register CopySrc = Copy->getOperand (1 ).getReg ();
552- // If the copy defines a register with a subreg, set that as the Subreg.
553- Subreg = Copy->getOperand (0 ).getSubReg ();
554550 if (!CopySrc.isVirtual ()) {
555551 const TargetRegisterInfo *TRI = &TII->getRegisterInfo ();
556552 // Loop backwards and return the first MI that modifies the physical CR Reg.
0 commit comments