Update Polly tests to handle explicitly typed gep changes in LLVM
[polly-mirror.git] / test / Isl / CodeGen / simple_vec_call.ll
blob78bf38e160829c81f5f62f0e1e01520712ada9da
1 ; RUN: opt %loadPolly -polly-detect-unprofitable -basicaa -polly-codegen-isl %vector-opt -S < %s | FileCheck %s
2 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"
3 target triple = "x86_64-unknown-linux-gnu"
5 @A = common global [1024 x float] zeroinitializer, align 16
6 @B = common global [1024 x float] zeroinitializer, align 16
8 declare float @foo(float) readnone
10 define void @simple_vec_call() nounwind {
11 entry:
12   br label %body
14 body:
15   %indvar = phi i64 [ 0, %entry ], [ %indvar_next, %body ]
16   %scevgep = getelementptr [1024 x float], [1024 x float]* @B, i64 0, i64 %indvar
17   %value = load float* getelementptr inbounds ([1024 x float]* @A, i64 0, i64 0), align 16
18   %result = tail call float @foo(float %value) nounwind
19   store float %result, float* %scevgep, align 4
20   %indvar_next = add i64 %indvar, 1
21   %exitcond = icmp eq i64 %indvar_next, 4
22   br i1 %exitcond, label %return, label %body
24 return:
25   ret void
28 ; CHECK: %value_p_splat_one = load <1 x float>* bitcast ([1024 x float]* @A to <1 x float>*), align 8
29 ; CHECK: %value_p_splat = shufflevector <1 x float> %value_p_splat_one, <1 x float> %value_p_splat_one, <4 x i32> zeroinitializer
30 ; CHECK: %0 = extractelement <4 x float> %value_p_splat, i32 0
31 ; CHECK: %1 = extractelement <4 x float> %value_p_splat, i32 1
32 ; CHECK: %2 = extractelement <4 x float> %value_p_splat, i32 2
33 ; CHECK: %3 = extractelement <4 x float> %value_p_splat, i32 3
34 ; CHECK: [[RES1:%[a-zA-Z0-9_]+]] = tail call float @foo(float %0) [[NUW:#[0-9]+]]
35 ; CHECK: [[RES2:%[a-zA-Z0-9_]+]] = tail call float @foo(float %1) [[NUW]]
36 ; CHECK: [[RES3:%[a-zA-Z0-9_]+]] = tail call float @foo(float %2) [[NUW]]
37 ; CHECK: [[RES4:%[a-zA-Z0-9_]+]] = tail call float @foo(float %3) [[NUW]]
38 ; CHECK: %4 = insertelement <4 x float> undef, float [[RES1]], i32 0
39 ; CHECK: %5 = insertelement <4 x float> %4, float [[RES2]], i32 1
40 ; CHECK: %6 = insertelement <4 x float> %5, float [[RES3]], i32 2
41 ; CHECK: %7 = insertelement <4 x float> %6, float [[RES4]], i32 3
42 ; CHECK:  store <4 x float> %7
43 ; CHECK: attributes [[NUW]] = { nounwind }