diff options
author | Dan Gohman <gohman@apple.com> | 2009-10-15 00:36:22 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2009-10-15 00:36:22 +0000 |
commit | cd2ae14ce3f16f0cef162aa85707f32295c4ee3d (patch) | |
tree | 9c5c5e06172adee6e626318c24a3e6e276370dfe /test/CodeGen/X86 | |
parent | a2f80471345960c971825a053d22ec886a2ab514 (diff) | |
download | external_llvm-cd2ae14ce3f16f0cef162aa85707f32295c4ee3d.zip external_llvm-cd2ae14ce3f16f0cef162aa85707f32295c4ee3d.tar.gz external_llvm-cd2ae14ce3f16f0cef162aa85707f32295c4ee3d.tar.bz2 |
Make CodePlacementOpt align loops, rather than loop headers. The
header is just the entry block to the loop, and it needn't be at
the top of the loop in the code layout.
Remove the code that suppressed loop alignment for outer loops,
so that outer loops are aligned.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84158 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/X86')
-rw-r--r-- | test/CodeGen/X86/avoid-loop-align-2.ll | 6 | ||||
-rw-r--r-- | test/CodeGen/X86/avoid-loop-align.ll | 9 |
2 files changed, 13 insertions, 2 deletions
diff --git a/test/CodeGen/X86/avoid-loop-align-2.ll b/test/CodeGen/X86/avoid-loop-align-2.ll index 03e69e7..fc9d1f0 100644 --- a/test/CodeGen/X86/avoid-loop-align-2.ll +++ b/test/CodeGen/X86/avoid-loop-align-2.ll @@ -1,4 +1,8 @@ -; RUN: llc < %s -march=x86 | grep align | count 3 +; RUN: llc < %s -march=x86 | grep align | count 4 + +; TODO: Is it a good idea to align inner loops? It's hard to know without +; knowing what their trip counts are, or other dynamic information. For +; now, CodeGen aligns all loops. @x = external global i32* ; <i32**> [#uses=1] diff --git a/test/CodeGen/X86/avoid-loop-align.ll b/test/CodeGen/X86/avoid-loop-align.ll index 3e68f94..d4c5c67 100644 --- a/test/CodeGen/X86/avoid-loop-align.ll +++ b/test/CodeGen/X86/avoid-loop-align.ll @@ -1,4 +1,11 @@ -; RUN: llc < %s -mtriple=i386-apple-darwin | grep align | count 1 +; RUN: llc < %s -mtriple=i386-apple-darwin | FileCheck %s + +; CodeGen should align the top of the loop, which differs from the loop +; header in this case. + +; CHECK: jmp LBB1_2 +; CHECK: .align +; CHECK: LBB1_1: @A = common global [100 x i32] zeroinitializer, align 32 ; <[100 x i32]*> [#uses=1] |