brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.9 KiB · ea3356e Raw
55 lines · plain
1; RUN: opt %loadNPMPolly -polly-invariant-load-hoisting=true '-passes=polly-custom<scops>' -polly-print-scops -disable-output < %s 2>&1 | FileCheck %s2;3;    void f(unsigned long *restrict I, unsigned *restrict A, unsigned N) {4;      for (unsigned i = 0; i < N; i++) {5;        unsigned V = *I;6;        if (V < i)7;          A[i]++;8;      }9;    }10;11; CHECK:         Assumed Context:12; CHECK-NEXT:    [N, tmp] -> { : }13; CHECK-NEXT:    Invalid Context:14; CHECK-NEXT:    [N, tmp] -> { : N > 0 and (tmp < 0 or tmp >= 2147483648) }15;16; CHECK:         Domain :=17; CHECK-NEXT:    [N, tmp] -> { Stmt_if_then[i0] : tmp >= 0 and tmp < i0 < N };18;19target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"20 21define void @f(ptr noalias %I, ptr noalias %A, i32 %N, i32 %M) {22entry:23  br label %for.cond24 25for.cond:                                         ; preds = %for.inc, %entry26  %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ]27  %lftr.wideiv = trunc i64 %indvars.iv to i3228  %exitcond = icmp ne i32 %lftr.wideiv, %N29  br i1 %exitcond, label %for.body, label %for.end30 31for.body:                                         ; preds = %for.cond32  %tmp = load i64, ptr %I, align 833  %conv = trunc i64 %tmp to i3234  %tmp1 = zext i32 %conv to i6435  %cmp1 = icmp ult i64 %tmp1, %indvars.iv36  br i1 %cmp1, label %if.then, label %if.end37 38if.then:                                          ; preds = %for.body39  %arrayidx = getelementptr inbounds i32, ptr %A, i64 %indvars.iv40  %tmp2 = load i32, ptr %arrayidx, align 441  %inc = add i32 %tmp2, 142  store i32 %inc, ptr %arrayidx, align 443  br label %if.end44 45if.end:                                           ; preds = %if.then, %for.body46  br label %for.inc47 48for.inc:                                          ; preds = %if.end49  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 150  br label %for.cond51 52for.end:                                          ; preds = %for.cond53  ret void54}55