[llvm] r275178 - [AArch64] Set FMOVS0 and FMOVD0 as isAsCheapAsAMove when needed.

Haicheng Wu via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 12 08:31:42 PDT 2016


Author: haicheng
Date: Tue Jul 12 10:31:41 2016
New Revision: 275178

URL: http://llvm.org/viewvc/llvm-project?rev=275178&view=rev
Log:
[AArch64] Set FMOVS0 and FMOVD0 as isAsCheapAsAMove when needed.

If a subtarget has both ZCZeroing and CustomCheapAsMoveHandling features (now
only Kryo has both), set FMOVS0 and FMOVD0 isAsCheapAsAMove.

Differential Revision: http://reviews.llvm.org/D22256

Modified:
    llvm/trunk/lib/Target/AArch64/AArch64InstrInfo.cpp
    llvm/trunk/test/CodeGen/AArch64/arm64-zero-cycle-zeroing.ll

Modified: llvm/trunk/lib/Target/AArch64/AArch64InstrInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/AArch64InstrInfo.cpp?rev=275178&r1=275177&r2=275178&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AArch64/AArch64InstrInfo.cpp (original)
+++ llvm/trunk/lib/Target/AArch64/AArch64InstrInfo.cpp Tue Jul 12 10:31:41 2016
@@ -620,6 +620,12 @@ bool AArch64InstrInfo::isAsCheapAsAMove(
     return canBeExpandedToORR(MI, 32);
   case AArch64::MOVi64imm:
     return canBeExpandedToORR(MI, 64);
+
+  // It is cheap to move #0 to float registers if the subtarget has 
+  // ZeroCycleZeroing feature.
+  case AArch64::FMOVS0:
+  case AArch64::FMOVD0:
+    return Subtarget.hasZeroCycleZeroing();
   }
 
   llvm_unreachable("Unknown opcode to check as cheap as a move!");

Modified: llvm/trunk/test/CodeGen/AArch64/arm64-zero-cycle-zeroing.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AArch64/arm64-zero-cycle-zeroing.ll?rev=275178&r1=275177&r2=275178&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/AArch64/arm64-zero-cycle-zeroing.ll (original)
+++ llvm/trunk/test/CodeGen/AArch64/arm64-zero-cycle-zeroing.ll Tue Jul 12 10:31:41 2016
@@ -13,9 +13,9 @@ entry:
 ; CYCLONE: movi.2d v2, #0000000000000000
 ; CYCLONE: movi.2d v3, #0000000000000000
 ; KRYO: movi v0.2d, #0000000000000000
-; KRYO: mov v1.16b, v0.16b 
-; KRYO: mov v2.16b, v0.16b 
-; KRYO: mov v3.16b, v0.16b
+; KRYO: movi v1.2d, #0000000000000000
+; KRYO: movi v2.2d, #0000000000000000
+; KRYO: movi v3.2d, #0000000000000000
   tail call void @bar(double 0.000000e+00, double 0.000000e+00, double 0.000000e+00, double 0.000000e+00) nounwind
   ret void
 }
@@ -46,7 +46,7 @@ define void @t4() nounwind ssp {
 ; CYCLONE: movi.2d v0, #0000000000000000
 ; CYCLONE: movi.2d v1, #0000000000000000
 ; KRYO: movi v0.2d, #0000000000000000
-; KRYO: mov v1.16b, v0.16b
+; KRYO: movi v1.2d, #0000000000000000
   tail call void @barf(float 0.000000e+00, float 0.000000e+00) nounwind
   ret void
 }




More information about the llvm-commits mailing list