1 ; RUN: opt < %s -passes=loop-vectorize,dce,instcombine -force-vector-interleave=1 -force-vector-width=4 -S -enable-if-conversion | FileCheck %s
3 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"
5 @A = global [36 x i32] [i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15, i32 16, i32 17, i32 18, i32 19, i32 20, i32 21, i32 22, i32 23, i32 24, i32 25, i32 26, i32 27, i32 28, i32 29, i32 30, i32 31, i32 32, i32 33, i32 34, i32 35], align 16
6 @B = global [36 x i32] [i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15, i32 16, i32 17, i32 18, i32 19, i32 20, i32 21, i32 22, i32 23, i32 24, i32 25, i32 26, i32 27, i32 28, i32 29, i32 30, i32 31, i32 32, i32 33, i32 34, i32 35], align 16
8 ;CHECK-LABEL:@_Z5test1v(
10 ;CHECK: shufflevector <4 x i32>
11 ;CHECK: store <4 x i32>
13 define i32 @_Z5test1v() nounwind uwtable ssp {
16 ; <label>:1 ; preds = %0, %1
17 %p.02 = phi ptr [ getelementptr inbounds ([36 x i32], ptr @A, i64 0, i64 18), %0 ], [ %4, %1 ]
18 %b.01 = phi ptr [ @B, %0 ], [ %5, %1 ]
19 %2 = load i32, ptr %b.01, align 4
20 %3 = shl nsw i32 %2, 1
21 store i32 %3, ptr %p.02, align 4
22 %4 = getelementptr inbounds i32, ptr %p.02, i64 -1
23 %5 = getelementptr inbounds i32, ptr %b.01, i64 1
24 %6 = icmp eq ptr %4, getelementptr ([36 x i32], ptr @A, i64 128102389400760775, i64 3)
25 br i1 %6, label %7, label %1
27 ; <label>:7 ; preds = %1
31 ;CHECK-LABEL: @_Z5test2v(
32 ;CHECK: load <4 x i32>
33 ;CHECK: shufflevector <4 x i32>
34 ;CHECK: store <4 x i32>
36 define i32 @_Z5test2v() nounwind uwtable ssp {
39 ; <label>:1 ; preds = %0, %1
40 %p.02 = phi ptr [ getelementptr inbounds ([36 x i32], ptr @A, i64 0, i64 25), %0 ], [ %3, %1 ]
41 %b.01 = phi ptr [ getelementptr inbounds ([36 x i32], ptr @B, i64 0, i64 2), %0 ], [ %4, %1 ]
42 %2 = load i32, ptr %b.01, align 4
43 store i32 %2, ptr %p.02, align 4
44 %3 = getelementptr inbounds i32, ptr %p.02, i64 -1
45 %4 = getelementptr inbounds i32, ptr %b.01, i64 1
46 %5 = icmp eq ptr %4, getelementptr inbounds ([36 x i32], ptr @A, i64 0, i64 18)
47 br i1 %5, label %6, label %1
49 ; <label>:6 ; preds = %1
54 ;CHECK: load <4 x i32>
55 ;CHECK: shufflevector <4 x i32>
56 ;CHECK: store <4 x i32>
58 define i32 @_Z5test3v() nounwind uwtable ssp {
61 ; <label>:1 ; preds = %0, %1
62 %p.02 = phi ptr [ getelementptr inbounds ([36 x i32], ptr @A, i64 0, i64 29), %0 ], [ %3, %1 ]
63 %b.01 = phi ptr [ getelementptr inbounds ([36 x i32], ptr @B, i64 0, i64 5), %0 ], [ %4, %1 ]
64 %2 = load i32, ptr %b.01, align 4
65 store i32 %2, ptr %p.02, align 4
66 %3 = getelementptr inbounds i32, ptr %p.02, i64 -1
67 %4 = getelementptr inbounds i32, ptr %b.01, i64 1
68 %5 = icmp eq ptr %3, getelementptr ([36 x i32], ptr @A, i64 128102389400760775, i64 3)
69 br i1 %5, label %6, label %1
71 ; <label>:6 ; preds = %1