brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.5 KiB · 9fe343f Raw
69 lines · plain
1; RUN: opt %loadNPMPolly '-passes=polly-custom<scops>' -polly-print-scops -polly-invariant-load-hoisting=true -disable-output < %s 2>&1 | FileCheck %s --check-prefix=SCOP2; RUN: opt %loadNPMPolly '-passes=polly<no-default-opts>' -polly-invariant-load-hoisting=true -S < %s | FileCheck %s3;4; SCOP:         Assumed Context:5; SCOP-NEXT:    [p_0, tmp4] -> {  :  }6; SCOP-NEXT:    Invalid Context:7; SCOP-NEXT:    [p_0, tmp4] -> {  : p_0 > 0 and tmp4 < 0 }8; SCOP:         p0: (%N * %M)9; SCOP-NEXT:    p1: %tmp410;11; CHECK:      polly.preload.merge:12;13;    void f(int *restrict A, int *restrict B, int N, int M) {14;15;      for (int i = 0; i < N * M; i++)16;        for (int j = 0; j < A[N * M] / 2; j++)17;          B[i + j]++;18;    }19;20target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"21 22define void @f(i32* noalias %A, i32* noalias %B, i32 %N, i32 %M) {23entry:24  br label %for.cond25 26for.cond:                                         ; preds = %for.inc.8, %entry27  %indvars.iv2 = phi i64 [ %indvars.iv.next3, %for.inc.8 ], [ 0, %entry ]28  %mul = mul nsw i32 %N, %M29  %tmp = sext i32 %mul to i6430  %cmp = icmp slt i64 %indvars.iv2, %tmp31  br i1 %cmp, label %for.body, label %for.end.1032 33for.body:                                         ; preds = %for.cond34  br label %for.cond.135 36for.cond.1:                                       ; preds = %for.inc, %for.body37  %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %for.body ]38  %mul2 = mul nsw i32 %N, %M39  %idxprom = sext i32 %mul2 to i6440  %arrayidx = getelementptr inbounds i32, i32* %A, i64 %idxprom41  %tmp4 = load i32, i32* %arrayidx, align 442  %div = udiv i32 %tmp4, 243  %tmp5 = sext i32 %div to i6444  %cmp3 = icmp slt i64 %indvars.iv, %tmp545  br i1 %cmp3, label %for.body.4, label %for.end46 47for.body.4:                                       ; preds = %for.cond.148  %tmp6 = add nsw i64 %indvars.iv2, %indvars.iv49  %arrayidx6 = getelementptr inbounds i32, i32* %B, i64 %tmp650  %tmp7 = load i32, i32* %arrayidx6, align 451  %inc = add nsw i32 %tmp7, 152  store i32 %inc, i32* %arrayidx6, align 453  br label %for.inc54 55for.inc:                                          ; preds = %for.body.456  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 157  br label %for.cond.158 59for.end:                                          ; preds = %for.cond.160  br label %for.inc.861 62for.inc.8:                                        ; preds = %for.end63  %indvars.iv.next3 = add nuw nsw i64 %indvars.iv2, 164  br label %for.cond65 66for.end.10:                                       ; preds = %for.cond67  ret void68}69