brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.1 KiB · 5b03280 Raw
64 lines · plain
1; RUN: opt %loadNPMPolly -aa-pipeline=basic-aa -polly-parallel -polly-parallel-force -polly-invariant-load-hoisting=true '-passes=polly-custom<ast>' -polly-print-ast -disable-output < %s | FileCheck %s -check-prefix=AST2; RUN: opt %loadNPMPolly -aa-pipeline=basic-aa -polly-parallel -polly-parallel-force -polly-invariant-load-hoisting=true '-passes=polly<no-default-opts>' -S -verify-dom-info < %s | FileCheck %s -check-prefix=IR3 4; The interesting part of this test case is the instruction:5;   %tmp = bitcast i8* %call to i64**6; which is not part of the scop. In the SCEV based code generation not '%tmp',7; but %call is a parameter of the SCoP and we need to make sure its value is8; properly forwarded to the subfunction.9 10; AST: #pragma omp parallel for11; AST: for (int c0 = 0; c0 < cols; c0 += 1)12; AST:   Stmt_for_body(c0);13; AST: if (cols <= 0)14; AST:   Stmt_for_body(0);15 16; IR: @foo_polly_subfn17 18target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"19 20define void @foo(i64 %cols, ptr noalias %call) {21entry:22  br label %for.body23 24for.body:25  %indvar = phi i64 [ %indvar.next, %for.body ], [ 0, %entry ]26  %tmp1 = load ptr, ptr %call, align 827  %arrayidx.2 = getelementptr inbounds i64, ptr %tmp1, i64 %indvar28  store i64 1, ptr %arrayidx.2, align 429  %indvar.next = add nsw i64 %indvar, 130  %cmp = icmp slt i64 %indvar.next, %cols31  br i1 %cmp, label %for.body, label %end32 33end:34  ret void35}36 37; Another variation of this test case, now with even more of the index38; expression defined outside of the scop.39 40; AST: #pragma omp parallel for41; AST: for (int c0 = 0; c0 < cols; c0 += 1)42; AST:   Stmt_for_body(c0);43; AST: if (cols <= 0)44; AST:   Stmt_for_body(0);45 46; IR: @bar_polly_subfn47 48define void @bar(i64 %cols, ptr noalias %call) {49entry:50  br label %for.body51 52for.body:53  %indvar = phi i64 [ %indvar.next, %for.body ], [ 0, %entry ]54  %tmp1 = load ptr, ptr %call, align 855  %arrayidx.2 = getelementptr inbounds i64, ptr %tmp1, i64 %indvar56  store i64 1, ptr %arrayidx.2, align 457  %indvar.next = add nsw i64 %indvar, 158  %cmp = icmp slt i64 %indvar.next, %cols59  br i1 %cmp, label %for.body, label %end60 61end:62  ret void63}64