summaryrefslogtreecommitdiff
path: root/test/CodeGen/X86/loop-strength-reduce4.ll
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2010-02-12 10:34:29 +0000
committerDan Gohman <gohman@apple.com>2010-02-12 10:34:29 +0000
commit572645cf84060c0fc25cb91d38cb9079918b3a88 (patch)
tree0571ce42ea03d210844a627baea045fa36f16df5 /test/CodeGen/X86/loop-strength-reduce4.ll
parent5cef638855c9f2bb23a9c181cc47ddace8551f50 (diff)
downloadllvm-572645cf84060c0fc25cb91d38cb9079918b3a88.tar.gz
llvm-572645cf84060c0fc25cb91d38cb9079918b3a88.tar.bz2
llvm-572645cf84060c0fc25cb91d38cb9079918b3a88.tar.xz
Reapply the new LoopStrengthReduction code, with compile time and
bug fixes, and with improved heuristics for analyzing foreign-loop addrecs. This change also flattens IVUsers, eliminating the stride-oriented groupings, which makes it easier to work with. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95975 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/X86/loop-strength-reduce4.ll')
-rw-r--r--test/CodeGen/X86/loop-strength-reduce4.ll18
1 files changed, 16 insertions, 2 deletions
diff --git a/test/CodeGen/X86/loop-strength-reduce4.ll b/test/CodeGen/X86/loop-strength-reduce4.ll
index 07e46eca75..6c0eb8c0df 100644
--- a/test/CodeGen/X86/loop-strength-reduce4.ll
+++ b/test/CodeGen/X86/loop-strength-reduce4.ll
@@ -1,5 +1,19 @@
-; RUN: llc < %s -march=x86 | grep cmp | grep 64
-; RUN: llc < %s -march=x86 | not grep inc
+; RUN: llc < %s -march=x86 -relocation-model=static -mtriple=i686-apple-darwin | FileCheck %s -check-prefix=STATIC
+; RUN: llc < %s -march=x86 -relocation-model=pic | FileCheck %s -check-prefix=PIC
+
+; By starting the IV at -64 instead of 0, a cmp is eliminated,
+; as the flags from the add can be used directly.
+
+; STATIC: movl $-64, %ecx
+
+; STATIC: movl %eax, _state+76(%ecx)
+; STATIC: addl $16, %ecx
+; STATIC: jne
+
+; In PIC mode the symbol can't be folded, so the change-compare-stride
+; trick applies.
+
+; PIC: cmpl $64
@state = external global [0 x i32] ; <[0 x i32]*> [#uses=4]
@S = external global [0 x i32] ; <[0 x i32]*> [#uses=4]