llvm.org GIT mirror llvm / bbea614
Continue slp vectorization even the BB already has vectorized store radar://16641956 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207572 91177308-0d34-0410-b5e6-96231b3b80d8 Yi Jiang 5 years ago
2 changed file(s) with 32 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
21152115 // Check that the pointer points to scalars.
21162116 Type *Ty = SI->getValueOperand()->getType();
21172117 if (Ty->isAggregateType() || Ty->isVectorTy())
2118 return 0;
2118 continue;
21192119
21202120 // Find the base pointer.
21212121 Value *Ptr = GetUnderlyingObject(SI->getPointerOperand(), DL);
0 ; RUN: opt < %s -basicaa -slp-vectorizer -S -mtriple=x86_64-apple-macosx10.8.0 -mcpu=corei7-avx | FileCheck %s
1
2 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
3 target triple = "x86_64-apple-macosx10.8.0"
4
5 ; We will keep trying to vectorize the basic block even we already find vectorized store.
6 ; CHECK: test1
7 ; CHECK: store <2 x double>
8 ; CHECK: ret
9 define void @test1(double* %a, double* %b, double* %c, double* %d) {
10 entry:
11 %i0 = load double* %a, align 8
12 %i1 = load double* %b, align 8
13 %mul = fmul double %i0, %i1
14 %arrayidx3 = getelementptr inbounds double* %a, i64 1
15 %i3 = load double* %arrayidx3, align 8
16 %arrayidx4 = getelementptr inbounds double* %b, i64 1
17 %i4 = load double* %arrayidx4, align 8
18 %mul5 = fmul double %i3, %i4
19 store double %mul, double* %c, align 8
20 %arrayidx5 = getelementptr inbounds double* %c, i64 1
21 store double %mul5, double* %arrayidx5, align 8
22 %0 = bitcast double* %a to <4 x i32>*
23 %1 = load <4 x i32>* %0, align 8
24 %2 = bitcast double* %b to <4 x i32>*
25 %3 = load <4 x i32>* %2, align 8
26 %4 = mul <4 x i32> %1, %3
27 %5 = bitcast double* %d to <4 x i32>*
28 store <4 x i32> %4, <4 x i32>* %5, align 8
29 ret void
30 }