1 ; RUN: opt %loadPolly -polly-import-jscop -polly-import-jscop-postfix=transformed -polly-codegen -S < %s | FileCheck %s
3 ; A load must provide a value for every statement instance.
4 ; Statement instances not in the SCoP's context are irrelevant.
6 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
8 @ATH = external dso_local unnamed_addr constant [88 x float], align 16
10 define void @load_subset_with_context() {
12 %ath = alloca [56 x float], align 16
15 for.cond176.preheader: ; preds = %for.cond33.preheader
18 for.body: ; preds = %for.cond33.preheader, %entry
19 %indvars.iv999 = phi i64 [ 0, %entry ], [ %indvars.iv.next1000, %for.cond33.preheader ]
20 %tmp5 = shl nsw i64 %indvars.iv999, 2
21 br label %for.cond7.preheader
23 for.cond33.preheader: ; preds = %for.inc.3
24 %tmp175 = load float, ptr undef, align 4
25 %indvars.iv.next1000 = add nuw nsw i64 %indvars.iv999, 1
26 %exitcond1002 = icmp eq i64 %indvars.iv.next1000, 17
27 br i1 %exitcond1002, label %for.cond176.preheader, label %for.body
29 for.cond7.preheader: ; preds = %for.inc.3, %for.body
30 %indvars.iv958 = phi i64 [ 0, %for.body ], [ %indvars.iv.next959, %for.inc.3 ]
31 %tmp20 = add nuw nsw i64 %indvars.iv958, %tmp5
32 %arrayidx.2 = getelementptr inbounds [88 x float], ptr @ATH, i64 0, i64 0
33 %tmp157 = load float, ptr %arrayidx.2, align 4
34 %tmp158 = add nuw nsw i64 %tmp20, 3
35 %cmp12.3 = icmp ult i64 %tmp158, 88
36 br i1 %cmp12.3, label %if.then.3, label %if.else.3
38 if.else.3: ; preds = %for.cond7.preheader
41 if.then.3: ; preds = %for.cond7.preheader
44 for.inc.3: ; preds = %if.then.3, %if.else.3
45 %min.1.3 = phi float [ undef, %if.then.3 ], [ %tmp157, %if.else.3 ]
46 %arrayidx29 = getelementptr inbounds [56 x float], ptr %ath, i64 0, i64 %indvars.iv958
47 store float %min.1.3, ptr %arrayidx29, align 4
48 %indvars.iv.next959 = add nuw nsw i64 %indvars.iv958, 1
49 %exitcond961 = icmp eq i64 %indvars.iv.next959, 56
50 br i1 %exitcond961, label %for.cond33.preheader, label %for.cond7.preheader
54 ; CHECK: polly.stmt.if.else.3:
55 ; CHECK-NEXT: %polly.access.ath1 = getelementptr float, ptr %ath, i64 %polly.indvar
56 ; CHECK-NEXT: %polly.access.ath1.reload = load float, ptr %polly.access.ath1