]> granicus.if.org Git - llvm/commitdiff
[AArch64] Set FMOVS0 and FMOVD0 as isAsCheapAsAMove when needed.
authorHaicheng Wu <haicheng@codeaurora.org>
Tue, 12 Jul 2016 15:31:41 +0000 (15:31 +0000)
committerHaicheng Wu <haicheng@codeaurora.org>
Tue, 12 Jul 2016 15:31:41 +0000 (15:31 +0000)
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275178 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/AArch64/AArch64InstrInfo.cpp
test/CodeGen/AArch64/arm64-zero-cycle-zeroing.ll

index f5a5dd5894a4351703fcfeb70e69849db6c91943..de881e75ce4ca347e21d622ef39cd9b321306abc 100644 (file)
@@ -620,6 +620,12 @@ bool AArch64InstrInfo::isAsCheapAsAMove(const MachineInstr &MI) const {
     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!");
index 8946466b18d2e42bb5546294b0e5d73400a770c3..ae77f7e099dbcbbeefe56166669e2808b171f83b 100644 (file)
@@ -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
 }