49 lines · plain
1; RUN: opt %loadNPMPolly '-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: [c] -> { Stmt_if_then[i0] -> MemRef_I[0] };6; CHECK-NEXT: Execution Context: [c] -> { : 0 <= c <= 126 }7; CHECK-NEXT: }8;9; void f(int *A, unsigned char c, int *I) {10; for (int i = 0; i < 10; i++)11; if ((signed char)(c + (unsigned char)1) > 0)12; A[i] += I[0];13; }14;15target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"16 17define void @f(ptr %A, i8 zeroext %c, ptr %I) {18entry:19 br label %for.cond20 21for.cond: ; preds = %for.inc, %entry22 %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ]23 %exitcond = icmp ne i64 %indvars.iv, 1024 br i1 %exitcond, label %for.body, label %for.end25 26for.body: ; preds = %for.cond27 %add = add i8 %c, 128 %cmp3 = icmp sgt i8 %add, 029 br i1 %cmp3, label %if.then, label %if.end30 31if.then: ; preds = %for.body32 %tmp = load i32, ptr %I, align 433 %arrayidx5 = getelementptr inbounds i32, ptr %A, i64 %indvars.iv34 %tmp1 = load i32, ptr %arrayidx5, align 435 %add6 = add nsw i32 %tmp1, %tmp36 store i32 %add6, ptr %arrayidx5, align 437 br label %if.end38 39if.end: ; preds = %if.then, %for.body40 br label %for.inc41 42for.inc: ; preds = %if.end43 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 144 br label %for.cond45 46for.end: ; preds = %for.cond47 ret void48}49