brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.6 KiB · d612faf Raw
45 lines · plain
1; RUN: opt %loadNPMPolly -polly-parallel -polly-parallel-force '-passes=polly-custom<ast>' -polly-print-ast -disable-output < %s | FileCheck %s -check-prefix=AST2; RUN: opt %loadNPMPolly -polly-parallel -polly-parallel-force '-passes=polly<no-default-opts>' -S < %s | FileCheck %s -check-prefix=IR3 4; Make sure we correctly forward the reference to 'A' to the OpenMP subfunction.5;6; void loop_references_outer_ids(float *A) {7;   for (long i = 0; i < 100; i++)8;     A[i] = i;9; }10 11 12; AST: #pragma simd13; AST: #pragma omp parallel for14; AST: for (int c0 = 0; c0 <= 99; c0 += 1)15; AST:   Stmt_for_body(c0);16 17; IR-LABEL: polly.parallel.for:18; IR-NEXT:  %polly.subfn.storeaddr.A = getelementptr inbounds nuw { ptr }, ptr %polly.par.userContext, i32 0, i32 019; IR-NEXT:  store ptr %A, ptr %polly.subfn.storeaddr.A20 21target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"22 23define void @loop_references_outer_ids(ptr %A) {24entry:25  br label %for.cond26 27for.cond:                                         ; preds = %for.inc, %entry28  %i.0 = phi i64 [ 0, %entry ], [ %inc, %for.inc ]29  %exitcond = icmp ne i64 %i.0, 10030  br i1 %exitcond, label %for.body, label %for.end31 32for.body:                                         ; preds = %for.cond33  %conv = sitofp i64 %i.0 to float34  %arrayidx = getelementptr inbounds float, ptr %A, i64 %i.035  store float %conv, ptr %arrayidx, align 436  br label %for.inc37 38for.inc:                                          ; preds = %for.body39  %inc = add nsw i64 %i.0, 140  br label %for.cond41 42for.end:                                          ; preds = %for.cond43  ret void44}45