llvm.org GIT mirror llvm / 505bc50
[Vectorization] Actually return from error case in isStridedPtr The early return seems to be missed. This causes a radical and wrong loop optimization on powerpc. It isn't reproducible on x86_64, because "UseInterleaved" is false. Patch by Tim Shen. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257134 91177308-0d34-0410-b5e6-96231b3b80d8 Kyle Butt 4 years ago
2 changed file(s) with 30 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
844844 if (Lp != AR->getLoop()) {
845845 DEBUG(dbgs() << "LAA: Bad stride - Not striding over innermost loop " <<
846846 *Ptr << " SCEV: " << *PtrScev << "\n");
847 return 0;
847848 }
848849
849850 // The address calculation must not wrap. Otherwise, a dependence could be
0 ; RUN: opt -loop-vectorize -force-vector-interleave=1 -S < %s | FileCheck %s
1 ; CHECK-LABEL: TestFoo
2 ; CHECK-NOT: %wide.vec
3
4 target datalayout = "e-m:e-i64:64-n32:64"
5 target triple = "powerpc64le-unknown-linux-gnu"
6
7 define void @TestFoo(i1 %X, i1 %Y) {
8 bb:
9 br label %.loopexit5.outer
10
11 .loopexit5.outer:
12 br label %.lr.ph12
13
14 .loopexit:
15 br i1 %X, label %.loopexit5.outer, label %.lr.ph12
16
17 .lr.ph12:
18 %f.110 = phi i32* [ %tmp1, %.loopexit ], [ null, %.loopexit5.outer ]
19 %tmp1 = getelementptr inbounds i32, i32* %f.110, i64 -2
20 br i1 %Y, label %bb4, label %.loopexit
21
22 bb4:
23 %j.27 = phi i32 [ 0, %.lr.ph12 ], [ %tmp7, %bb4 ]
24 %tmp5 = load i32, i32* %f.110, align 4
25 %tmp7 = add nsw i32 %j.27, 1
26 %exitcond = icmp eq i32 %tmp7, 0
27 br i1 %exitcond, label %.loopexit, label %bb4
28 }