fix a missing shuffle pattern, PR9009. Patch by Artiom Myaskouvskey!
[oota-llvm.git] / test / CodeGen / X86 / loop-strength-reduce4.ll
index 07e46eca75e9f4f5ad8474ab429b6c7950c905f4..6556fdeea83401e3aff1ba7b0144e7c6789d0ce1 100644 (file)
@@ -1,5 +1,19 @@
-; RUN: llc < %s -march=x86 | grep cmp | grep 64
-; RUN: llc < %s -march=x86 | not grep inc
+; RUN: llc < %s -mtriple=i686-apple-darwin -relocation-model=static | FileCheck %s -check-prefix=STATIC
+; RUN: llc < %s -mtriple=i686-apple-darwin -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]