brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.8 KiB · 9221ddf Raw
57 lines · plain
1; RUN: opt %loadNPMPolly '-passes=polly-custom<detect>' -polly-print-detect -disable-output < %s 2>&1 | FileCheck %s -check-prefix=DETECT2 3; RUN: opt %loadNPMPolly '-passes=polly-custom<scops>' -polly-print-scops -disable-output < %s 2>&1 | FileCheck %s -check-prefix=SCOPS4 5target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"6 7; DETECT: Valid Region for Scop: test1.header => test1.exit8; SCOPS-NOT: Region: %test1.header---%test1.exit9 10; Verify that we detect this scop, but that, due to an infeasible run-time11; check, we refuse to model it.12 13define void @test(ptr %a) nounwind uwtable {14preheader:15  br label %test1.header16 17test1.header:18  %i = phi i56 [ 0, %preheader ], [ %i.1, %test1.header ]19  %tmp = zext i56 %i to i6420  %A.addr = getelementptr i64, ptr %a, i64 %tmp21  %A.load = load i64, ptr %A.addr, align 422  %A.inc = zext i56 %i to i6423  %A.val = add nsw i64 %A.load, %A.inc24  store i64 %A.val, ptr %A.addr, align 425  %i.1 = add i56 %i, 126  %exitcond = icmp eq i56 %i.1, 027  br i1 %exitcond, label %test1.exit, label %test1.header28 29test1.exit:30  ret void31}32 33; Old version of the previous test; make sure we compute the trip count34; correctly.35 36; SCOPS: { Stmt_header[i0] : 0 <= i0 <= 127 };37 38define void @test2(ptr %a) nounwind uwtable {39preheader:40  br label %header41 42header:43  %i = phi i7 [ 0, %preheader ], [ %i.1, %header ]44  %tmp = zext i7 %i to i6445  %A.addr = getelementptr [128 x i32], ptr %a, i64 0, i64 %tmp46  %A.load = load i32, ptr %A.addr, align 447  %A.inc = zext i7 %i to i3248  %A.val = add nsw i32 %A.load, %A.inc49  store i32 %A.val, ptr %A.addr, align 450  %i.1 = add i7 %i, 151  %exitcond = icmp eq i7 %i.1, 052  br i1 %exitcond, label %exit, label %header53 54exit:55  ret void56}57