aboutsummaryrefslogtreecommitdiffstats
path: root/test/Transforms
diff options
context:
space:
mode:
authorNadav Rotem <nrotem@apple.com>2013-05-10 22:59:33 +0000
committerNadav Rotem <nrotem@apple.com>2013-05-10 22:59:33 +0000
commit9bba9f630005409f43bc3b0480e18fa9f8d43e69 (patch)
tree1dbc0e17fa72f098ec38d772e18c135578ce149d /test/Transforms
parent09ec4b21648700f9d4ef5bc90d732f90f32c930c (diff)
downloadexternal_llvm-9bba9f630005409f43bc3b0480e18fa9f8d43e69.zip
external_llvm-9bba9f630005409f43bc3b0480e18fa9f8d43e69.tar.gz
external_llvm-9bba9f630005409f43bc3b0480e18fa9f8d43e69.tar.bz2
SLPVectorizer: Add support for trees with external users.
For example: bar() { int a = A[i]; int b = A[i+1]; B[i] = a; B[i+1] = b; foo(a); <--- a is used outside the vectorized expression. } git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181648 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms')
-rw-r--r--test/Transforms/SLPVectorizer/X86/diamond.ll9
1 files changed, 5 insertions, 4 deletions
diff --git a/test/Transforms/SLPVectorizer/X86/diamond.ll b/test/Transforms/SLPVectorizer/X86/diamond.ll
index 8e85cb6..49c8712 100644
--- a/test/Transforms/SLPVectorizer/X86/diamond.ll
+++ b/test/Transforms/SLPVectorizer/X86/diamond.ll
@@ -41,7 +41,7 @@ entry:
}
-; int foo_fail(int * restrict B, int * restrict A, int n, int m) {
+; int extr_user(int * restrict B, int * restrict A, int n, int m) {
; B[0] = n * A[0] + m * A[0];
; B[1] = n * A[1] + m * A[1];
; B[2] = n * A[2] + m * A[2];
@@ -49,10 +49,11 @@ entry:
; return A[0];
; }
-; CHECK: @foo_fail
-; CHECK-NOT: load <4 x i32>
+; CHECK: @extr_user
+; CHECK: store <4 x i32>
+; CHECK-NEXT: extractelement <4 x i32>
; CHECK: ret
-define i32 @foo_fail(i32* noalias nocapture %B, i32* noalias nocapture %A, i32 %n, i32 %m) {
+define i32 @extr_user(i32* noalias nocapture %B, i32* noalias nocapture %A, i32 %n, i32 %m) {
entry:
%0 = load i32* %A, align 4
%mul238 = add i32 %m, %n