Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(391)

Side by Side Diff: test/Transforms/LoopVectorize/reverse_induction.ll

Issue 183273009: Prep for merging 3.4: Undo changes from 3.3 branch (Closed) Base URL: http://git.chromium.org/native_client/pnacl-llvm.git@master
Patch Set: Retry Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 ; RUN: opt < %s -loop-vectorize -force-vector-unroll=2 -force-vector-width=4 -S | FileCheck %s
2
3 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f3 2:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:6 4-S128"
4
5 ; Make sure consecutive vector generates correct negative indices.
6 ; PR15882
7
8 ; CHECK: reverse_induction_i64
9 ; CHECK: add <4 x i64> %[[SPLAT:.*]], <i64 0, i64 -1, i64 -2, i64 -3>
10 ; CHECK: add <4 x i64> %[[SPLAT]], <i64 -4, i64 -5, i64 -6, i64 -7>
11
12 define i32 @reverse_induction_i64(i64 %startval, i32 * %ptr) {
13 entry:
14 br label %for.body
15
16 for.body:
17 %add.i7 = phi i64 [ %startval, %entry ], [ %add.i, %for.body ]
18 %i.06 = phi i32 [ 0, %entry ], [ %inc4, %for.body ]
19 %redux5 = phi i32 [ 0, %entry ], [ %inc.redux, %for.body ]
20 %add.i = add i64 %add.i7, -1
21 %kind_.i = getelementptr inbounds i32* %ptr, i64 %add.i
22 %tmp.i1 = load i32* %kind_.i, align 4
23 %inc.redux = add i32 %tmp.i1, %redux5
24 %inc4 = add i32 %i.06, 1
25 %exitcond = icmp ne i32 %inc4, 1024
26 br i1 %exitcond, label %for.body, label %loopend
27
28 loopend:
29 ret i32 %inc.redux
30 }
31
32 ; CHECK: reverse_induction_i128
33 ; CHECK: add <4 x i128> %[[SPLAT:.*]], <i128 0, i128 -1, i128 -2, i128 -3>
34 ; CHECK: add <4 x i128> %[[SPLAT]], <i128 -4, i128 -5, i128 -6, i128 -7>
35 define i32 @reverse_induction_i128(i128 %startval, i32 * %ptr) {
36 entry:
37 br label %for.body
38
39 for.body:
40 %add.i7 = phi i128 [ %startval, %entry ], [ %add.i, %for.body ]
41 %i.06 = phi i32 [ 0, %entry ], [ %inc4, %for.body ]
42 %redux5 = phi i32 [ 0, %entry ], [ %inc.redux, %for.body ]
43 %add.i = add i128 %add.i7, -1
44 %kind_.i = getelementptr inbounds i32* %ptr, i128 %add.i
45 %tmp.i1 = load i32* %kind_.i, align 4
46 %inc.redux = add i32 %tmp.i1, %redux5
47 %inc4 = add i32 %i.06, 1
48 %exitcond = icmp ne i32 %inc4, 1024
49 br i1 %exitcond, label %for.body, label %loopend
50
51 loopend:
52 ret i32 %inc.redux
53 }
54
55 ; CHECK: reverse_induction_i16
56 ; CHECK: add <4 x i16> %[[SPLAT:.*]], <i16 0, i16 -1, i16 -2, i16 -3>
57 ; CHECK: add <4 x i16> %[[SPLAT]], <i16 -4, i16 -5, i16 -6, i16 -7>
58
59 define i32 @reverse_induction_i16(i16 %startval, i32 * %ptr) {
60 entry:
61 br label %for.body
62
63 for.body:
64 %add.i7 = phi i16 [ %startval, %entry ], [ %add.i, %for.body ]
65 %i.06 = phi i32 [ 0, %entry ], [ %inc4, %for.body ]
66 %redux5 = phi i32 [ 0, %entry ], [ %inc.redux, %for.body ]
67 %add.i = add i16 %add.i7, -1
68 %kind_.i = getelementptr inbounds i32* %ptr, i16 %add.i
69 %tmp.i1 = load i32* %kind_.i, align 4
70 %inc.redux = add i32 %tmp.i1, %redux5
71 %inc4 = add i32 %i.06, 1
72 %exitcond = icmp ne i32 %inc4, 1024
73 br i1 %exitcond, label %for.body, label %loopend
74
75 loopend:
76 ret i32 %inc.redux
77 }
78
79
OLDNEW
« no previous file with comments | « test/Transforms/LoopVectorize/no_outside_user.ll ('k') | test/Transforms/LoopVectorize/value-ptr-bug.ll » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698