1; RUN: opt %loadPolly -basic-aa -polly-codegen -polly-vectorizer=polly -S \ 2; RUN: -polly-invariant-load-hoisting=true < %s | FileCheck %s 3 4;#define N 1024 5;float A[N]; 6;float B[N]; 7; 8;void simple_vec_const(void) { 9; int i; 10; 11; for (i = 0; i < 4; i++) 12; B[i] = A[0]; 13;} 14;int main() 15;{ 16; simple_vec_const(); 17; return A[42]; 18;} 19 20target 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" 21 22@A = common global [1024 x float] zeroinitializer, align 16 23@B = common global [1024 x float] zeroinitializer, align 16 24 25define void @simple_vec_const() nounwind { 26; <label>:0 27 br label %1 28 29; <label>:1 ; preds = %4, %0 30 %indvar = phi i64 [ %indvar.next, %4 ], [ 0, %0 ] 31 %scevgep = getelementptr [1024 x float], [1024 x float]* @B, i64 0, i64 %indvar 32 %exitcond = icmp ne i64 %indvar, 4 33 br i1 %exitcond, label %2, label %5 34 35; <label>:2 ; preds = %1 36 %3 = load float, float* getelementptr inbounds ([1024 x float], [1024 x float]* @A, i64 0, i64 0), align 16 37 store float %3, float* %scevgep, align 4 38 br label %4 39 40; <label>:4 ; preds = %2 41 %indvar.next = add i64 %indvar, 1 42 br label %1 43 44; <label>:5 ; preds = %1 45 ret void 46} 47 48define i32 @main() nounwind { 49 call void @simple_vec_const() 50 %1 = load float, float* getelementptr inbounds ([1024 x float], [1024 x float]* @A, i64 0, i64 42), align 8 51 %2 = fptosi float %1 to i32 52 ret i32 %2 53} 54 55 56; CHECK: %.load = load float, float* getelementptr inbounds ([1024 x float], [1024 x float]* @A, i32 0, i32 0) 57 58; CHECK: polly.stmt.: ; preds = %polly.start 59; CHECK: %_p.splatinsert = insertelement <4 x float> undef, float %.load, i32 0 60; CHECK: %_p.splat = shufflevector <4 x float> %_p.splatinsert, <4 x float> undef, <4 x i32> zeroinitializer 61