1 ; RUN: opt %loadPolly -polly-codegen -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"
12 define void @scalar-function-argument(ptr %A, float %sqrinv) {
17 %indvar = phi i64 [ %indvar.next, %for.body ], [ 0, %entry ]
18 %mul104 = fmul float 1.0, %sqrinv
19 %rp107 = getelementptr float, ptr %A, i64 %indvar
20 store float %mul104, ptr %rp107, align 4
21 %indvar.next = add nsw i64 %indvar, 1
22 %cmp = icmp slt i64 1024, %indvar.next
23 br i1 %cmp, label %for.end, label %for.body
29 ; CHECH-LABEL: @scalar-outside-of-scop
30 ; CHECK: polly.split_new_and_old
32 define void @scalar-outside-of-scop(ptr %A) {
34 %sqrinv = call float @getFloat()
38 %indvar = phi i64 [ %indvar.next, %for.body ], [ 0, %entry ]
39 %mul104 = fmul float 1.0, %sqrinv
40 %rp107 = getelementptr float, ptr %A, i64 %indvar
41 store float %mul104, ptr %rp107, align 4
42 %indvar.next = add nsw i64 %indvar, 1
43 %cmp = icmp slt i64 1024, %indvar.next
44 br i1 %cmp, label %for.end, label %for.body
50 declare float @getFloat()