56 lines · plain
1; RUN: opt %loadNPMPolly '-passes=polly-custom<scops>' -polly-print-scops -disable-output < %s 2>&1 | FileCheck %s2;3; Check that we create two alias groups since the minimal/maximal accesses4; depend on %b.5;6; CHECK: Alias Groups (2):7;8; void jd(int b, int *A, int *B) {9; for (int i = 0; i < 1024; i++) {10; if (b)11; A[i] = B[5];12; else13; B[i] = A[7];14; }15; }16;17target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"18 19define void @jd(i32 %b, ptr %A, ptr %B) {20entry:21 br label %for.cond22 23for.cond: ; preds = %for.inc, %entry24 %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ]25 %exitcond = icmp ne i64 %indvars.iv, 102426 br i1 %exitcond, label %for.body, label %for.end27 28for.body: ; preds = %for.cond29 %tobool = icmp eq i32 %b, 030 br i1 %tobool, label %if.else, label %if.then31 32if.then: ; preds = %for.body33 %arrayidx = getelementptr inbounds i32, ptr %B, i64 534 %tmp = load i32, ptr %arrayidx, align 435 %arrayidx1 = getelementptr inbounds i32, ptr %A, i64 %indvars.iv36 store i32 %tmp, ptr %arrayidx1, align 437 br label %if.end38 39if.else: ; preds = %for.body40 %arrayidx2 = getelementptr inbounds i32, ptr %A, i64 741 %tmp1 = load i32, ptr %arrayidx2, align 442 %arrayidx4 = getelementptr inbounds i32, ptr %B, i64 %indvars.iv43 store i32 %tmp1, ptr %arrayidx4, align 444 br label %if.end45 46if.end: ; preds = %if.else, %if.then47 br label %for.inc48 49for.inc: ; preds = %if.end50 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 151 br label %for.cond52 53for.end: ; preds = %for.cond54 ret void55}56