[llvm-commits] [llvm-gcc-4.2] r130950 - /llvm-gcc-4.2/trunk/gcc/config/arm/arm.h
Bill Wendling
isanbard at gmail.com
Thu May 5 14:30:59 PDT 2011
Author: void
Date: Thu May 5 16:30:59 2011
New Revision: 130950
URL: http://llvm.org/viewvc/llvm-project?rev=130950&view=rev
Log:
ARM was generating C-strings that were unnecessarily well-aligned. This wastes
memory because one aligned C-string makes *all* strings in that section
aligned. But C-strings don't need to be so well-aligned.
<rdar://problem/8961909>
Modified:
llvm-gcc-4.2/trunk/gcc/config/arm/arm.h
Modified: llvm-gcc-4.2/trunk/gcc/config/arm/arm.h
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/arm/arm.h?rev=130950&r1=130949&r2=130950&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/config/arm/arm.h (original)
+++ llvm-gcc-4.2/trunk/gcc/config/arm/arm.h Thu May 5 16:30:59 2011
@@ -646,10 +646,15 @@
/* Make strings word-aligned so strcpy from constants will be faster. */
#define CONSTANT_ALIGNMENT_FACTOR (TARGET_THUMB || ! arm_tune_xscale ? 1 : 2)
-#define CONSTANT_ALIGNMENT(EXP, ALIGN) \
- ((TREE_CODE (EXP) == STRING_CST \
- && (ALIGN) < BITS_PER_WORD * CONSTANT_ALIGNMENT_FACTOR) \
- ? BITS_PER_WORD * CONSTANT_ALIGNMENT_FACTOR : (ALIGN))
+/* LLVM LOCAL begin - <rdar://problem/8961909> */
+#define CONSTANT_ALIGNMENT(EXP, ALIGN) \
+ (TARGET_MACHO && TREE_CODE (EXP) == STRING_CST ? \
+ (ALIGN) : \
+ (TREE_CODE (EXP) == STRING_CST \
+ && (ALIGN) < BITS_PER_WORD * CONSTANT_ALIGNMENT_FACTOR) ? \
+ BITS_PER_WORD * CONSTANT_ALIGNMENT_FACTOR : \
+ (ALIGN))
+/* LLVM LOCAL end - <rdar://problem/8961909> */
/* Setting STRUCTURE_SIZE_BOUNDARY to 32 produces more efficient code, but the
value set in previous versions of this toolchain was 8, which produces more
More information about the llvm-commits
mailing list