1 ; RUN: opt %loadPolly -basic-aa -polly-allow-differing-element-types -polly-print-scops -disable-output < %s | FileCheck %s
2 ; RUN: opt %loadPolly -S -basic-aa -polly-allow-differing-element-types -polly-codegen < %s | FileCheck --check-prefix=IR %s
5 ; CHECK-NEXT: i8 MemRef_A[*]; // Element size 1
6 ; CHECK-NEXT: i8 MemRef_B[*]; // Element size 1
9 ; CHECK-NEXT: Stmt_for_body3
10 ; CHECK-NEXT: Domain :=
11 ; CHECK-NEXT: { Stmt_for_body3[i0, i1] : 0 <= i0 <= 1023 and 0 <= i1 <= 1023 };
12 ; CHECK-NEXT: Schedule :=
13 ; CHECK-NEXT: { Stmt_for_body3[i0, i1] -> [i0, i1] };
14 ; CHECK-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 0]
15 ; CHECK-NEXT: { Stmt_for_body3[i0, i1] -> MemRef_A[o0] : -16 <= o0 <= 20 };
16 ; CHECK-NEXT: ReadAccess := [Reduction Type: NONE] [Scalar: 0]
17 ; CHECK-NEXT: { Stmt_for_body3[i0, i1] -> MemRef_B[o0] : 64 <= o0 <= 100 };
19 ; IR: polly.loop_preheader:
20 ; IR: %[[r1:[a-zA-Z0-9]*]] = getelementptr i8, ptr %A, i64 -16
21 ; IR: %[[r3:[a-zA-Z0-9]*]] = getelementptr i8, ptr %B, i64 64
23 ; IR: polly.stmt.for.body3:
24 ; IR: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %[[r1]], ptr align 4 %[[r3]], i64 37, i1 false)
29 ; void jd(int *restrict A, long *restrict B) {
30 ; for (int i = 0; i < 1024; i++)
31 ; for (int j = 0; j < 1024; j++)
32 ; memcpy(A - 4, B + 8, 37);
35 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
37 define void @jd(ptr noalias %A, ptr noalias %B) {
41 for.cond: ; preds = %for.inc5, %entry
42 %i.0 = phi i32 [ 0, %entry ], [ %inc6, %for.inc5 ]
43 %exitcond1 = icmp ne i32 %i.0, 1024
44 br i1 %exitcond1, label %for.body, label %for.end7
46 for.body: ; preds = %for.cond
49 for.cond1: ; preds = %for.inc, %for.body
50 %j.0 = phi i32 [ 0, %for.body ], [ %inc, %for.inc ]
51 %exitcond = icmp ne i32 %j.0, 1024
52 br i1 %exitcond, label %for.body3, label %for.end
54 for.body3: ; preds = %for.cond1
55 %add.ptr = getelementptr inbounds i32, ptr %A, i64 -4
56 %add.ptr4 = getelementptr inbounds i64, ptr %B, i64 8
57 call void @llvm.memcpy.p0.p0.i64(ptr %add.ptr, ptr %add.ptr4, i64 37, i32 4, i1 false)
60 for.inc: ; preds = %for.body3
61 %inc = add nsw i32 %j.0, 1
64 for.end: ; preds = %for.cond1
67 for.inc5: ; preds = %for.end
68 %inc6 = add nsw i32 %i.0, 1
71 for.end7: ; preds = %for.cond
75 declare void @llvm.memcpy.p0.p0.i64(ptr nocapture, ptr nocapture readonly, i64, i32, i1) #1