1 ; RUN: opt -loop-vectorize -S -mattr=avx512f < %s | FileCheck %s
3 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
4 target triple = "x86_64-unknown-linux-gnu"
6 ; This test checks that "gather" operation is choosen since it's cost is better
7 ; than interleaving pattern.
9 ;unsigned long A[SIZE];
10 ;unsigned long B[SIZE];
13 ; for (int i=0; i<N; i+=8) {
18 @A = global [10240 x i64] zeroinitializer, align 16
19 @B = global [10240 x i64] zeroinitializer, align 16
22 ; CHECK_LABEL: strided_load_i64
23 ; CHECK: masked.gather
24 define void @strided_load_i64() {
27 ; <label>:1: ; preds = %0, %1
28 %indvars.iv = phi i64 [ 0, %0 ], [ %indvars.iv.next, %1 ]
29 %2 = getelementptr inbounds [10240 x i64], [10240 x i64]* @A, i64 0, i64 %indvars.iv
30 %3 = load i64, i64* %2, align 16
32 %5 = getelementptr inbounds [10240 x i64], [10240 x i64]* @B, i64 0, i64 %indvars.iv
33 store i64 %4, i64* %5, align 16
34 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 8
35 %6 = icmp slt i64 %indvars.iv.next, 1024
36 br i1 %6, label %1, label %7
38 ; <label>:7: ; preds = %1