brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.7 KiB · cac6f4f Raw
52 lines · plain
1; RUN: opt %loadNPMPolly '-passes=polly-custom<ast>' -polly-print-ast -disable-output < %s | FileCheck %s2; RUN: opt %loadNPMPolly '-passes=polly<no-default-opts>' -S < %s | FileCheck %s -check-prefix=CODEGEN3;4 5;    void f(int a[], int N, float *P, float *Q) {6;      int i;7;      for (i = 0; i < N; ++i)8;        if (P != Q)9;          a[i] = i;10;    }11;12target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"13 14define void @f(ptr nocapture %a, i64 %N, ptr %P, ptr %Q) nounwind {15entry:16  br label %bb17 18bb:19  %i = phi i64 [ 0, %entry ], [ %i.inc, %bb.backedge ]20  %brcond = icmp ne ptr %P, %Q21  br i1 %brcond, label %store, label %bb.backedge22 23store:24  %scevgep = getelementptr inbounds i64, ptr %a, i64 %i25  store i64 %i, ptr %scevgep26  br label %bb.backedge27 28bb.backedge:29  %i.inc = add nsw i64 %i, 130  %exitcond = icmp eq i64 %i.inc, %N31  br i1 %exitcond, label %return, label %bb32 33return:34  ret void35}36 37; CHECK:      if (Q >= P + 1 || P >= Q + 1)38; CHECK-NEXT:   for (int c0 = 0; c0 < N; c0 += 1)39; CHECK-NEXT:     Stmt_store(c0);40 41; CODEGEN:       polly.cond:42; CODEGEN-NEXT:  %[[Q:[_a-zA-Z0-9]+]] = ptrtoint ptr %Q to i6443; CODEGEN-NEXT:  %[[P:[_a-zA-Z0-9]+]] = ptrtoint ptr %P to i6444; CODEGEN-NEXT:  %[[PInc:[_a-zA-Z0-9]+]] = add nsw i64 %[[P]], 145; CODEGEN-NEXT:  %[[CMP:[_a-zA-Z0-9]+]] = icmp sge i64 %[[Q]], %[[PInc]]46; CODEGEN-NEXT:  %[[P2:[_a-zA-Z0-9]+]] = ptrtoint ptr %P to i6447; CODEGEN-NEXT:  %[[Q2:[_a-zA-Z0-9]+]] = ptrtoint ptr %Q to i6448; CODEGEN-NEXT:  %[[QInc:[_a-zA-Z0-9]+]] = add nsw i64 %[[Q2]], 149; CODEGEN-NEXT:  %[[CMP2:[_a-zA-Z0-9]+]] = icmp sge i64 %[[P2]], %[[QInc]]50; CODEGEN-NEXT:  %[[CMP3:[_a-zA-Z0-9]+]] = or i1 %[[CMP]], %[[CMP2]]51; CODEGEN-NEXT:  br i1 %[[CMP3]]52