@@ -5073,33 +5073,31 @@ void AArch64InstrInfo::copyPhysReg(MachineBasicBlock &MBB,
50735073 BuildMI (MBB, I, DL, get (AArch64::MOVZWi), DestReg)
50745074 .addImm (0 )
50755075 .addImm (AArch64_AM::getShifterImm (AArch64_AM::LSL, 0 ));
5076+ } else if (Subtarget.hasZeroCycleRegMoveGPR64 () &&
5077+ !Subtarget.hasZeroCycleRegMoveGPR32 ()) {
5078+ // Cyclone recognizes "ORR Xd, XZR, Xm" as a zero-cycle register move.
5079+ MCRegister DestRegX = TRI->getMatchingSuperReg (DestReg, AArch64::sub_32,
5080+ &AArch64::GPR64spRegClass);
5081+ assert (DestRegX.isValid () && " Destination super-reg not valid" );
5082+ MCRegister SrcRegX =
5083+ SrcReg == AArch64::WZR
5084+ ? AArch64::XZR
5085+ : TRI->getMatchingSuperReg (SrcReg, AArch64::sub_32,
5086+ &AArch64::GPR64spRegClass);
5087+ assert (SrcRegX.isValid () && " Source super-reg not valid" );
5088+ // This instruction is reading and writing X registers. This may upset
5089+ // the register scavenger and machine verifier, so we need to indicate
5090+ // that we are reading an undefined value from SrcRegX, but a proper
5091+ // value from SrcReg.
5092+ BuildMI (MBB, I, DL, get (AArch64::ORRXrr), DestRegX)
5093+ .addReg (AArch64::XZR)
5094+ .addReg (SrcRegX, RegState::Undef)
5095+ .addReg (SrcReg, RegState::Implicit | getKillRegState (KillSrc));
50765096 } else {
5077- if (Subtarget.hasZeroCycleRegMoveGPR64 () &&
5078- !Subtarget.hasZeroCycleRegMoveGPR32 ()) {
5079- // Cyclone recognizes "ORR Xd, XZR, Xm" as a zero-cycle register move.
5080- MCRegister DestRegX = TRI->getMatchingSuperReg (
5081- DestReg, AArch64::sub_32, &AArch64::GPR64spRegClass);
5082- assert (DestRegX.isValid () && " Destination super-reg not valid" );
5083- MCRegister SrcRegX =
5084- SrcReg == AArch64::WZR
5085- ? AArch64::XZR
5086- : TRI->getMatchingSuperReg (SrcReg, AArch64::sub_32,
5087- &AArch64::GPR64spRegClass);
5088- assert (SrcRegX.isValid () && " Source super-reg not valid" );
5089- // This instruction is reading and writing X registers. This may upset
5090- // the register scavenger and machine verifier, so we need to indicate
5091- // that we are reading an undefined value from SrcRegX, but a proper
5092- // value from SrcReg.
5093- BuildMI (MBB, I, DL, get (AArch64::ORRXrr), DestRegX)
5094- .addReg (AArch64::XZR)
5095- .addReg (SrcRegX, RegState::Undef)
5096- .addReg (SrcReg, RegState::Implicit | getKillRegState (KillSrc));
5097- } else {
5098- // Otherwise, expand to ORR WZR.
5099- BuildMI (MBB, I, DL, get (AArch64::ORRWrr), DestReg)
5100- .addReg (AArch64::WZR)
5101- .addReg (SrcReg, getKillRegState (KillSrc));
5102- }
5097+ // Otherwise, expand to ORR WZR.
5098+ BuildMI (MBB, I, DL, get (AArch64::ORRWrr), DestReg)
5099+ .addReg (AArch64::WZR)
5100+ .addReg (SrcReg, getKillRegState (KillSrc));
51035101 }
51045102 return ;
51055103 }
0 commit comments