1 ; RUN: opt %loadPolly -polly-codegen -S < %s | FileCheck %s --check-prefix=SCOPES
3 ; Check that we create alias scopes that indicate the accesses to A, B and C cannot alias in any way.
5 ; SCOPES-LABEL: polly.stmt.for.body:
6 ; SCOPES: %[[BIdx:[._a-zA-Z0-9]*]] = getelementptr{{.*}} ptr %B, i64 %{{.*}}
7 ; SCOPES: load i32, ptr %[[BIdx]], align 4, !alias.scope !0, !noalias !3
8 ; SCOPES: %[[CIdx:[._a-zA-Z0-9]*]] = getelementptr{{.*}} ptr %C, i64 %{{.*}}
9 ; SCOPES: load float, ptr %[[CIdx]], align 4, !alias.scope !6, !noalias !7
10 ; SCOPES: %[[AIdx:[._a-zA-Z0-9]*]] = getelementptr{{.*}} ptr %A, i64 %{{.*}}
11 ; SCOPES: store i32 %{{[._a-zA-Z0-9]*}}, ptr %[[AIdx]], align 4, !alias.scope !8, !noalias !9
14 ; SCOPES: !1 = distinct !{!1, !2, !"polly.alias.scope.MemRef_B"}
15 ; SCOPES: !2 = distinct !{!2, !"polly.alias.scope.domain"}
16 ; SCOPES: !3 = !{!4, !5}
17 ; SCOPES: !4 = distinct !{!4, !2, !"polly.alias.scope.MemRef_C"}
18 ; SCOPES: !5 = distinct !{!5, !2, !"polly.alias.scope.MemRef_A"}
20 ; SCOPES: !7 = !{!1, !5}
22 ; SCOPES: !9 = !{!1, !4}
24 ; void jd(int *A, int *B, float *C) {
25 ; for (int i = 0; i < 1024; i++)
29 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
31 define void @jd(ptr %A, ptr %B, ptr %C) {
35 for.cond: ; preds = %for.inc, %entry
36 %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ]
37 %exitcond = icmp ne i64 %indvars.iv, 1024
38 br i1 %exitcond, label %for.body, label %for.end
40 for.body: ; preds = %for.cond
41 %arrayidx = getelementptr inbounds i32, ptr %B, i64 %indvars.iv
42 %tmp = load i32, ptr %arrayidx, align 4
43 %conv = sitofp i32 %tmp to float
44 %arrayidx2 = getelementptr inbounds float, ptr %C, i64 %indvars.iv
45 %tmp1 = load float, ptr %arrayidx2, align 4
46 %add = fadd fast float %conv, %tmp1
47 %conv3 = fptosi float %add to i32
48 %arrayidx5 = getelementptr inbounds i32, ptr %A, i64 %indvars.iv
49 store i32 %conv3, ptr %arrayidx5, align 4
52 for.inc: ; preds = %for.body
53 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
56 for.end: ; preds = %for.cond