Update Polly tests to handle explicitly typed gep changes in LLVM
[polly-mirror.git] / test / Isl / CodeGen / scalar-references-used-in-scop-compute.ll
blobb642b4dec7eee20db3ee6d8f7d406610062a0b23
1 ; RUN: opt %loadPolly -polly-detect-unprofitable -polly-no-early-exit -polly-codegen-isl -S < %s | FileCheck %s
3 ; Test the code generation in the presence of a scalar out-of-scop value being
4 ; used from within the SCoP.
6 ; CHECH-LABEL: @scalar-function-argument
7 ; CHECK: polly.split_new_and_old
10 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
11 target triple = "x86_64-unknown-linux-gnu"
13 define void @scalar-function-argument(float* %A, float %sqrinv) {
14 entry:
15   br label %for.body
17 for.body:
18   %indvar = phi i64 [ %indvar.next, %for.body ], [ 0, %entry ]
19   %mul104 = fmul float 1.0, %sqrinv
20   %rp107 = getelementptr float, float* %A, i64 %indvar
21   store float %mul104, float* %rp107, align 4
22   %indvar.next = add nsw i64 %indvar, 1
23   %cmp = icmp slt i64 1024, %indvar.next
24   br i1 %cmp, label %for.end, label %for.body
26 for.end:
27   ret void
30 ; CHECH-LABEL: @scalar-outside-of-scop
31 ; CHECK: polly.split_new_and_old
33 define void @scalar-outside-of-scop(float* %A) {
34 entry:
35   %sqrinv = call float @getFloat()
36   br label %for.body
38 for.body:
39   %indvar = phi i64 [ %indvar.next, %for.body ], [ 0, %entry ]
40   %mul104 = fmul float 1.0, %sqrinv
41   %rp107 = getelementptr float, float* %A, i64 %indvar
42   store float %mul104, float* %rp107, align 4
43   %indvar.next = add nsw i64 %indvar, 1
44   %cmp = icmp slt i64 1024, %indvar.next
45   br i1 %cmp, label %for.end, label %for.body
47 for.end:
48   ret void
51 declare float @getFloat()