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) {
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
30 ; CHECH-LABEL: @scalar-outside-of-scop
31 ; CHECK: polly.split_new_and_old
33 define void @scalar-outside-of-scop(float* %A) {
35 %sqrinv = call float @getFloat()
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
51 declare float @getFloat()