Make ARM an X86 memcpy expansion more similar to each other.
Now both subtarget define getMaxInlineSizeThreshold and the expansion uses it.

This should not change generated code.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43552 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Target/ARM/ARMISelLowering.cpp b/lib/Target/ARM/ARMISelLowering.cpp
index 154832b..ef1c86d 100644
--- a/lib/Target/ARM/ARMISelLowering.cpp
+++ b/lib/Target/ARM/ARMISelLowering.cpp
@@ -1315,7 +1315,8 @@
   // this once Thumb ldmia / stmia support is added.
   unsigned Size = I->getValue();
   if (AlwaysInline ||
-      (!ST->isThumb() && Size < 64 && (Align & 3) == 0))
+      (!ST->isThumb() && Size <= Subtarget->getMaxInlineSizeThreshold() &&
+       (Align & 3) == 0))
     return LowerMEMCPYInline(ChainOp, DestOp, SourceOp, Size, Align, DAG);
   return LowerMEMCPYCall(ChainOp, DestOp, SourceOp, CountOp, DAG);
 }
diff --git a/lib/Target/ARM/ARMSubtarget.h b/lib/Target/ARM/ARMSubtarget.h
index 62367ca..5b5ee39 100644
--- a/lib/Target/ARM/ARMSubtarget.h
+++ b/lib/Target/ARM/ARMSubtarget.h
@@ -62,6 +62,7 @@
   ///
   ARMSubtarget(const Module &M, const std::string &FS, bool thumb);
 
+  unsigned getMaxInlineSizeThreshold() const { return 64; }
   /// ParseSubtargetFeatures - Parses features string setting specified 
   /// subtarget options.  Definition of function is auto generated by tblgen.
   void ParseSubtargetFeatures(const std::string &FS, const std::string &CPU);