diff options
| -rw-r--r-- | llvm/lib/Target/AArch64/AArch64InstrInfo.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp b/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp index 90d7df07f00..04fe3af1681 100644 --- a/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp +++ b/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp @@ -624,11 +624,15 @@ bool AArch64InstrInfo::isAsCheapAsAMove(const MachineInstr &MI) const { case AArch64::MOVi64imm: return canBeExpandedToORR(MI, 64); - // It is cheap to move #0 to float registers if the subtarget has - // ZeroCycleZeroing feature. + // It is cheap to zero out registers if the subtarget has ZeroCycleZeroing + // feature. case AArch64::FMOVS0: case AArch64::FMOVD0: return Subtarget.hasZeroCycleZeroing(); + case TargetOpcode::COPY: + return (Subtarget.hasZeroCycleZeroing() && + (MI.getOperand(1).getReg() == AArch64::WZR || + MI.getOperand(1).getReg() == AArch64::XZR)); } llvm_unreachable("Unknown opcode to check as cheap as a move!"); |

