[PATCH] D22360: [AArch64] Set COPY ZR isAsCheapAsAMove when needed.

Haicheng Wu via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 14 17:34:34 PDT 2016


This revision was automatically updated to reflect the committed changes.
Closed by commit rL275503: [AArch64] Set COPY ZR isAsCheapAsAMove when needed. (authored by haicheng).

Changed prior to commit:
  https://reviews.llvm.org/D22360?vs=63978&id=64069#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D22360

Files:
  llvm/trunk/lib/Target/AArch64/AArch64InstrInfo.cpp

Index: llvm/trunk/lib/Target/AArch64/AArch64InstrInfo.cpp
===================================================================
--- llvm/trunk/lib/Target/AArch64/AArch64InstrInfo.cpp
+++ llvm/trunk/lib/Target/AArch64/AArch64InstrInfo.cpp
@@ -624,11 +624,15 @@
   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!");


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D22360.64069.patch
Type: text/x-patch
Size: 887 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160715/1cf8077e/attachment.bin>


More information about the llvm-commits mailing list