brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.0 KiB · b509951 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 *restrict I, unsigned *restrict A, unsigned N, unsigned M) {4;      for (unsigned i = 0; i < N; i++) {5;        unsigned char V = *I;6;        if (V < M)7;          A[i]++;8;      }9;    }10;11; FIXME: The truncated value should be a parameter.12; CHECK:         Assumed Context:13; CHECK-NEXT:    [N, tmp, M] -> { : }14; CHECK-NEXT:    Invalid Context:15; CHECK-NEXT:    [N, tmp, M] -> { : N < 0 or (N > 0 and tmp >= 128) or (N > 0 and tmp < 0) or (N > 0 and M < 0) }16;17; CHECK:         Domain :=18; CHECK-NEXT:    [N, tmp, M] -> { Stmt_if_then[i0] : tmp >= 0 and M > tmp and 0 <= i0 < N };19;20target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"21 22define void @f(ptr noalias %I, ptr noalias %A, i32 %N, i32 %M) {23entry:24  br label %for.cond25 26for.cond:                                         ; preds = %for.inc, %entry27  %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ]28  %lftr.wideiv = trunc i64 %indvars.iv to i3229  %exitcond = icmp ne i32 %lftr.wideiv, %N30  br i1 %exitcond, label %for.body, label %for.end31 32for.body:                                         ; preds = %for.cond33  %tmp = load i32, ptr %I, align 434  %conv1 = and i32 %tmp, 25535  %cmp2 = icmp ult i32 %conv1, %M36  br i1 %cmp2, label %if.then, label %if.end37 38if.then:                                          ; preds = %for.body39  %arrayidx = getelementptr inbounds i32, ptr %A, i64 %indvars.iv40  %tmp1 = load i32, ptr %arrayidx, align 441  %inc = add i32 %tmp1, 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