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