43 lines · plain
1; RUN: opt %loadNPMPolly -polly-process-unprofitable '-passes=polly-custom<scops>' -polly-print-scops -polly-invariant-load-hoisting=true -disable-output < %s 2>&1 | FileCheck %s2;3; CHECK: Invariant Accesses:4; CHECK-NEXT: ReadAccess := [Reduction Type: NONE] [Scalar: 0]5; CHECK-NEXT: { Stmt_bb2[i0] -> MemRef_B[0] };6; CHECK-NOT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 1]7; CHECK-NOT: { Stmt_bb2[i0] -> MemRef_tmp[] };8;9; void f(int *restrict A, int *restrict B) {10; for (int i = 0; i < 1024; i++)11; auto tmp = *B;12; // Split BB13; A[i] = tmp;14; }15;16target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"17 18define void @f(ptr noalias %A, ptr noalias %B) {19bb:20 br label %bb121 22bb1: ; preds = %bb4, %bb23 %indvars.iv = phi i64 [ %indvars.iv.next, %bb4 ], [ 0, %bb ]24 %exitcond = icmp ne i64 %indvars.iv, 102425 br i1 %exitcond, label %bb2, label %bb526 27bb2: ; preds = %bb128 %tmp = load i32, ptr %B, align 429 br label %bb2b30 31bb2b:32 %tmp3 = getelementptr inbounds i32, ptr %A, i64 %indvars.iv33 store i32 %tmp, ptr %tmp3, align 434 br label %bb435 36bb4: ; preds = %bb237 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 138 br label %bb139 40bb5: ; preds = %bb141 ret void42}43