diff options
author | Evan Cheng <evan.cheng@apple.com> | 2006-03-17 19:45:54 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2006-03-17 19:45:54 +0000 |
commit | a3dc22f2d8945ed4cdcebe72be5ebefe413eade8 (patch) | |
tree | 5a41d18efb564ace5a4b8e1960eebeca793af4a5 | |
parent | d05c2236531a290908cf26cd3d94b002c94d18c3 (diff) | |
download | external_llvm-a3dc22f2d8945ed4cdcebe72be5ebefe413eade8.zip external_llvm-a3dc22f2d8945ed4cdcebe72be5ebefe413eade8.tar.gz external_llvm-a3dc22f2d8945ed4cdcebe72be5ebefe413eade8.tar.bz2 |
Add a lsr common loop invariant hoisting test case
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26827 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | test/CodeGen/X86/loop-strength-reduce.ll | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/test/CodeGen/X86/loop-strength-reduce.ll b/test/CodeGen/X86/loop-strength-reduce.ll new file mode 100644 index 0000000..5cf8d0a --- /dev/null +++ b/test/CodeGen/X86/loop-strength-reduce.ll @@ -0,0 +1,28 @@ +; RUN: llvm-as < %s | llc -march=x86 -enable-x86-lsr | grep 'A(' | wc -l | grep 1 +; +; Make sure the common loop invariant _A(reg) is hoisted up to preheader. + +%A = internal global [16 x [16 x int]] zeroinitializer, align 32 + +void %test(int %row, int %N) { +entry: + %N = cast int %N to uint + %tmp5 = setgt int %N, 0 + br bool %tmp5, label %cond_true, label %return + +cond_true: + %indvar = phi uint [ 0, %entry ], [ %indvar.next, %cond_true ] + %i.0.0 = cast uint %indvar to int + %tmp2 = add int %i.0.0, 1 + %tmp = getelementptr [16 x [16 x int]]* %A, int 0, int %row, int %tmp2 + store int 4, int* %tmp + %tmp5 = add int %i.0.0, 2 + %tmp7 = getelementptr [16 x [16 x int]]* %A, int 0, int %row, int %tmp5 + store int 5, int* %tmp7 + %indvar.next = add uint %indvar, 1 + %exitcond = seteq uint %indvar.next, %N + br bool %exitcond, label %return, label %cond_true + +return: + ret void +} |