brintos

brintos / llvm-project-archived public Read only

0
0
Text · 3.7 KiB · 91aa96e Raw
81 lines · plain
1; RUN: opt %loadNPMPolly -polly-stmt-granularity=bb '-passes=polly-custom<scops>' -polly-print-scops -disable-output < %s 2>&1 | FileCheck %s -check-prefix=NONAFFINE2; RUN: opt %loadNPMPolly -polly-stmt-granularity=bb '-passes=polly-custom<scops>' -polly-print-scops -disable-output -polly-allow-nonaffine-branches=false < %s 2>&1 | FileCheck %s -check-prefix=NO-NONEAFFINE3 4; NONAFFINE:      Statements {5; NONAFFINE-NEXT: 	Stmt_loop6; NONAFFINE-NEXT:         Domain :=7; NONAFFINE-NEXT:             [p] -> { Stmt_loop[0] : p = 100 };8; NONAFFINE-NEXT:         Schedule :=9; NONAFFINE-NEXT:             [p] -> { Stmt_loop[i0] -> [0, 0] };10; NONAFFINE-NEXT:         MustWriteAccess :=	[Reduction Type: NONE] [Scalar: 0]11; NONAFFINE-NEXT:             [p] -> { Stmt_loop[i0] -> MemRef_A[0] };12; NONAFFINE-NEXT:         MustWriteAccess :=	[Reduction Type: NONE] [Scalar: 1]13; NONAFFINE-NEXT:             [p] -> { Stmt_loop[i0] -> MemRef_cmp[] };14; NONAFFINE-NEXT: 	Stmt_branch__TO__end15; NONAFFINE-NEXT:         Domain :=16; NONAFFINE-NEXT:             [p] -> { Stmt_branch__TO__end[] : p = 100 };17; NONAFFINE-NEXT:         Schedule :=18; NONAFFINE-NEXT:             [p] -> { Stmt_branch__TO__end[] -> [1, 0] };19; NONAFFINE-NEXT:         ReadAccess :=	[Reduction Type: NONE] [Scalar: 1]20; NONAFFINE-NEXT:             [p] -> { Stmt_branch__TO__end[] -> MemRef_cmp[] };21; NONAFFINE-NEXT:         MayWriteAccess :=	[Reduction Type: NONE] [Scalar: 0]22; NONAFFINE-NEXT:             [p] -> { Stmt_branch__TO__end[] -> MemRef_A[0] };23; NONAFFINE-NEXT: }24 25; NO-NONEAFFINE:      Statements {26; NO-NONEAFFINE-NEXT:    	Stmt_then27; NO-NONEAFFINE-NEXT:            Domain :=28; NO-NONEAFFINE-NEXT:                [p_0, p] -> { Stmt_then[] : p >= 2 + p_0 or p <= p_0 };29; NO-NONEAFFINE-NEXT:            Schedule :=30; NO-NONEAFFINE-NEXT:                [p_0, p] -> { Stmt_then[] -> [] };31; NO-NONEAFFINE-NEXT:            MustWriteAccess :=	[Reduction Type: NONE] [Scalar: 0]32; NO-NONEAFFINE-NEXT:                [p_0, p] -> { Stmt_then[] -> MemRef_A[0] };33; NO-NONEAFFINE-NEXT:    }34 35; NO-NONEAFFINE:      Statements {36; NO-NONEAFFINE-NEXT: 	Stmt_loop37; NO-NONEAFFINE-NEXT:         Domain :=38; NO-NONEAFFINE-NEXT:             [p] -> { Stmt_loop[0] : p = 100 };39; NO-NONEAFFINE-NEXT:         Schedule :=40; NO-NONEAFFINE-NEXT:             [p] -> { Stmt_loop[i0] -> [0] };41; NO-NONEAFFINE-NEXT:         MustWriteAccess :=	[Reduction Type: NONE] [Scalar: 0]42; NO-NONEAFFINE-NEXT:             [p] -> { Stmt_loop[i0] -> MemRef_A[0] };43; NO-NONEAFFINE-NEXT:         MustWriteAccess :=	[Reduction Type: NONE] [Scalar: 1]44; NO-NONEAFFINE-NEXT:             [p] -> { Stmt_loop[i0] -> MemRef_cmp[] };45; NO-NONEAFFINE-NEXT: }46 47; Verify that this test case does not crash -polly-scops. The problem in48; this test case is that the branch instruction in %branch references49; a scalar evolution expression for which no useful value can be computed at the50; location %branch, as the loop %loop does not terminate. At some point, we51; did not identify the branch condition as non-affine during scop detection.52; This test verifies that we either model the branch condition as non-affine53; region or only detect a smaller region if non-affine conditions are not54; allowed.55 56target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"57target triple = "aarch64--linux-android"58 59define void @f(i16 %event, i8 %p, ptr %A) {60entry:61  br label %loop62 63loop:64  %indvar = phi i8 [ 0, %entry ], [ %indvar.next, %loop ]65  %indvar.next = add i8 %indvar, 166  store float 1.0, ptr %A67  %cmp = icmp eq i8 %indvar.next, %p68  %possibly_infinite = icmp eq i8 100, %p69  br i1 %possibly_infinite, label %branch, label %loop70 71branch:72  br i1 %cmp, label %end, label %then73 74then:75  store float 1.0, ptr %A76  br label %end77 78end:79  ret void80}81