1; RUN: opt %loadNPMPolly -passes=polly-codegen -S < %s | FileCheck %s 2 3; Test the code generation in the presence of a scalar out-of-scop value being 4; used from within the SCoP. 5 6; CHECH-LABEL: @scalar-function-argument 7; CHECK: polly.split_new_and_old 8 9 10target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" 11 12define void @scalar-function-argument(ptr %A, float %sqrinv) { 13entry: 14 br label %for.body 15 16for.body: 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 24 25for.end: 26 ret void 27} 28 29; CHECH-LABEL: @scalar-outside-of-scop 30; CHECK: polly.split_new_and_old 31 32define void @scalar-outside-of-scop(ptr %A) { 33entry: 34 %sqrinv = call float @getFloat() 35 br label %for.body 36 37for.body: 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 45 46for.end: 47 ret void 48} 49 50declare float @getFloat() 51