brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.2 KiB · f86ddce Raw
62 lines · plain
1; RUN: opt %loadNPMPolly '-passes=polly-custom<scops>' -polly-print-scops -disable-output < %s 2>&1 | FileCheck %s2;3; CHECK:         Assumed Context:4; CHECK-NEXT:    [N] -> {  :  }5; CHECK-NEXT:    Invalid Context:6; CHECK-NEXT:    [N] -> {  : false }7; CHECK:         p0: %N8; CHECK:         Statements {9; CHECK-NEXT:    	Stmt_if_then10; CHECK-NEXT:            Domain :=11; CHECK-NEXT:                [N] -> { Stmt_if_then[i0] : (1 + i0) mod 2 = 0 and 0 < i0 < N }12; CHECK-NEXT:            Schedule :=13; CHECK-NEXT:                [N] -> { Stmt_if_then[i0] -> [i0] };14; CHECK-NEXT:            ReadAccess :=	[Reduction Type: +] [Scalar: 0]15; CHECK-NEXT:                [N] -> { Stmt_if_then[i0] -> MemRef_A[i0] };16; CHECK-NEXT:            MustWriteAccess :=	[Reduction Type: +] [Scalar: 0]17; CHECK-NEXT:                [N] -> { Stmt_if_then[i0] -> MemRef_A[i0] };18; CHECK-NEXT:    }19;20;    void f(int *A, int N) {21;      for (int i = 0; i < N; i++) {22;        if (i & 1)23;          A[i]++;24;      }25;    }26;27target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"28 29define void @f(ptr %A, i32 %N) {30entry:31  %tmp = sext i32 %N to i6432  br label %for.cond33 34for.cond:                                         ; preds = %for.inc, %entry35  %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ]36  %cmp = icmp slt i64 %indvars.iv, %tmp37  br i1 %cmp, label %for.body, label %for.end38 39for.body:                                         ; preds = %for.cond40  %tmp1 = trunc i64 %indvars.iv to i3241  %and = and i32 %tmp1, 142  %tobool = icmp eq i32 %and, 043  br i1 %tobool, label %if.end, label %if.then44 45if.then:                                          ; preds = %for.body46  %arrayidx = getelementptr inbounds i32, ptr %A, i64 %indvars.iv47  %tmp2 = load i32, ptr %arrayidx, align 448  %inc = add nsw i32 %tmp2, 149  store i32 %inc, ptr %arrayidx, align 450  br label %if.end51 52if.end:                                           ; preds = %for.body, %if.then53  br label %for.inc54 55for.inc:                                          ; preds = %if.end56  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 157  br label %for.cond58 59for.end:                                          ; preds = %for.cond60  ret void61}62