[PATCH] D35568: [AArch64] Use 8 bytes as preferred function alignment on Cortex-A53.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 24 03:38:06 PDT 2017


fhahn updated this revision to Diff 107876.
fhahn retitled this revision from "[AArch64] Use 16 bytes as preferred function alignment on Cortex-A53." to "[AArch64] Use 8 bytes as preferred function alignment on Cortex-A53.".
fhahn edited the summary of this revision.
fhahn added a comment.

Using 8 byte alignment gives a 0.25% speedup on execution time (was 0.23% with 16 bytes), a 0.82% improvement
in benchmark scores  (was 0.93% with 16 bytes) and  a 0.20% increase in binary size (was 0.55%). So for the score related benchmarks, the 8 byte alignment makes things worse quite a bit, but the impact on size is much smaller. Should we use 8 byte alignment, to keep the binary size down?


https://reviews.llvm.org/D35568

Files:
  lib/Target/AArch64/AArch64Subtarget.cpp
  test/CodeGen/AArch64/preferred-function-alignment.ll


Index: test/CodeGen/AArch64/preferred-function-alignment.ll
===================================================================
--- test/CodeGen/AArch64/preferred-function-alignment.ll
+++ test/CodeGen/AArch64/preferred-function-alignment.ll
@@ -1,9 +1,9 @@
 ; RUN: llc -mtriple=aarch64-unknown-linux -mcpu=generic < %s | FileCheck --check-prefixes=ALIGN2,CHECK %s
 ; RUN: llc -mtriple=aarch64-unknown-linux -mcpu=cortex-a35 < %s | FileCheck --check-prefixes=ALIGN2,CHECK %s
-; RUN: llc -mtriple=aarch64-unknown-linux -mcpu=cortex-a53 < %s | FileCheck --check-prefixes=ALIGN2,CHECK %s
 ; RUN: llc -mtriple=aarch64-unknown-linux -mcpu=cyclone < %s | FileCheck --check-prefixes=ALIGN2,CHECK %s
 ; RUN: llc -mtriple=aarch64-unknown-linux -mcpu=falkor < %s | FileCheck --check-prefixes=ALIGN2,CHECK %s
 ; RUN: llc -mtriple=aarch64-unknown-linux -mcpu=kryo < %s | FileCheck --check-prefixes=ALIGN2,CHECK %s
+; RUN: llc -mtriple=aarch64-unknown-linux -mcpu=cortex-a53 < %s | FileCheck --check-prefixes=ALIGN3,CHECK %s
 ; RUN: llc -mtriple=aarch64-unknown-linux -mcpu=thunderx < %s | FileCheck --check-prefixes=ALIGN3,CHECK %s
 ; RUN: llc -mtriple=aarch64-unknown-linux -mcpu=thunderxt81 < %s | FileCheck --check-prefixes=ALIGN3,CHECK %s
 ; RUN: llc -mtriple=aarch64-unknown-linux -mcpu=thunderxt83 < %s | FileCheck --check-prefixes=ALIGN3,CHECK %s
Index: lib/Target/AArch64/AArch64Subtarget.cpp
===================================================================
--- lib/Target/AArch64/AArch64Subtarget.cpp
+++ lib/Target/AArch64/AArch64Subtarget.cpp
@@ -130,7 +130,9 @@
     MinVectorRegisterBitWidth = 128;
     break;
   case CortexA35: break;
-  case CortexA53: break;
+  case CortexA53:
+    PrefFunctionAlignment = 3;
+    break;
   case CortexA72:
     PrefFunctionAlignment = 4;
     break;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D35568.107876.patch
Type: text/x-patch
Size: 1793 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170724/c8922ea6/attachment.bin>


More information about the llvm-commits mailing list