[llvm-commits] [127367] Make ARM more aggressive about using target-dependent

johannes at apple.com johannes at apple.com
Thu May 17 16:47:23 PDT 2007


Revision: 127367
Author:   johannes
Date:     2007-05-17 16:47:22 -0700 (Thu, 17 May 2007)

Log Message:
-----------
Make ARM more aggressive about using target-dependent
memcpy expansion for aggregate copy.

Modified Paths:
--------------
    apple-local/branches/llvm/gcc/config/arm/arm.h
    apple-local/branches/llvm/gcc/llvm-convert.cpp

Modified: apple-local/branches/llvm/gcc/config/arm/arm.h
===================================================================
--- apple-local/branches/llvm/gcc/config/arm/arm.h	2007-05-17 21:04:42 UTC (rev 127366)
+++ apple-local/branches/llvm/gcc/config/arm/arm.h	2007-05-17 23:47:22 UTC (rev 127367)
@@ -2923,4 +2923,8 @@
 #define LLVM_OVERRIDE_TARGET_ARCH() \
   (TARGET_THUMB ? "thumb" : "")
 
+/* Doing struct copy by partial-word loads and stores is not a good idea on ARM. */
+#define TARGET_LLVM_MIN_BYTES_COPY_BY_MEMCPY 4
+/* APPLE LOCAL end llvm */
+
 #endif /* ! GCC_ARM_H */

Modified: apple-local/branches/llvm/gcc/llvm-convert.cpp
===================================================================
--- apple-local/branches/llvm/gcc/llvm-convert.cpp	2007-05-17 21:04:42 UTC (rev 127366)
+++ apple-local/branches/llvm/gcc/llvm-convert.cpp	2007-05-17 23:47:22 UTC (rev 127367)
@@ -1120,6 +1120,10 @@
   }
 }
 
+#ifndef TARGET_LLVM_MIN_BYTES_COPY_BY_MEMCPY
+#define TARGET_LLVM_MIN_BYTES_COPY_BY_MEMCPY 64
+#endif
+
 /// EmitAggregateCopy - Copy the elements from SrcPtr to DestPtr, using the
 /// GCC type specified by GCCType to know which elements to copy.
 void TreeToLLVM::EmitAggregateCopy(Value *DestPtr, Value *SrcPtr, tree type,
@@ -1129,7 +1133,8 @@
 
   // If the type is small, copy the elements instead of using a block copy.
   if (TREE_CODE(TYPE_SIZE(type)) == INTEGER_CST &&
-      TREE_INT_CST_LOW(TYPE_SIZE_UNIT(type)) < 64) {
+      TREE_INT_CST_LOW(TYPE_SIZE_UNIT(type)) <
+          TARGET_LLVM_MIN_BYTES_COPY_BY_MEMCPY) {
     const Type *LLVMTy = ConvertType(type);
     if (CountAggregateElements(LLVMTy) <= 8) {
       DestPtr = CastToType(Instruction::BitCast, DestPtr, 





More information about the llvm-commits mailing list