51 lines · plain
1; RUN: opt %loadNPMPolly '-passes=polly<no-default-opts>' -S < %s | FileCheck %s2 3; Test the code generation in the presence of a scalar out-of-scop value being4; used from within the SCoP.5 6; CHECK-LABEL: @scalar-function-argument7; CHECK: polly.split_new_and_old8 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.body15 16for.body:17 %indvar = phi i64 [ %indvar.next, %for.body ], [ 0, %entry ]18 %mul104 = fmul float 1.0, %sqrinv19 %rp107 = getelementptr float, ptr %A, i64 %indvar20 store float %mul104, ptr %rp107, align 421 %indvar.next = add nsw i64 %indvar, 122 %cmp = icmp slt i64 1024, %indvar.next23 br i1 %cmp, label %for.end, label %for.body24 25for.end:26 ret void27}28 29; CHECK-LABEL: @scalar-outside-of-scop30; CHECK: polly.split_new_and_old31 32define void @scalar-outside-of-scop(ptr %A) {33entry:34 %sqrinv = call float @getFloat()35 br label %for.body36 37for.body:38 %indvar = phi i64 [ %indvar.next, %for.body ], [ 0, %entry ]39 %mul104 = fmul float 1.0, %sqrinv40 %rp107 = getelementptr float, ptr %A, i64 %indvar41 store float %mul104, ptr %rp107, align 442 %indvar.next = add nsw i64 %indvar, 143 %cmp = icmp slt i64 1024, %indvar.next44 br i1 %cmp, label %for.end, label %for.body45 46for.end:47 ret void48}49 50declare float @getFloat()51