[LoopVectorize] Up the maximum unroll factor to 4 for AArch64
authorJames Molloy <james.molloy@arm.com>
Thu, 21 Aug 2014 00:02:51 +0000 (00:02 +0000)
committerJames Molloy <james.molloy@arm.com>
Thu, 21 Aug 2014 00:02:51 +0000 (00:02 +0000)
Only for Cortex-A57 and Cyclone for now, where it has shown wins.

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

lib/Target/AArch64/AArch64TargetTransformInfo.cpp

index 2058dd06b21862d1c831c3890e16f36e5d89f67d..24cb129b0b77a9de802614f8fa1d2da675c6c18e 100644 (file)
@@ -104,7 +104,7 @@ public:
     return 64;
   }
 
-  unsigned getMaximumUnrollFactor() const override { return 2; }
+  unsigned getMaximumUnrollFactor() const override;
 
   unsigned getCastInstrCost(unsigned Opcode, Type *Dst, Type *Src) const
       override;
@@ -513,3 +513,9 @@ unsigned AArch64TTI::getCostOfKeepingLiveOverCall(ArrayRef<Type*> Tys) const {
   }
   return Cost;
 }
+
+unsigned AArch64TTI::getMaximumUnrollFactor() const {
+  if (ST->isCortexA57() || ST->isCyclone())
+    return 4;
+  return 2;
+}