brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.9 KiB · ce785d6 Raw
51 lines · plain
1; RUN: opt %loadNPMPolly '-passes=polly-custom<prepare;scops>' -polly-print-scops -tailcallopt -disable-output < %s 2>&1 | FileCheck %s --check-prefix=LICM2 3;    void foo(int n, float A[static const restrict n], float x) {4;      //      (0)5;      for (int i = 0; i < 5; i += 1) {6;        for (int j = 0; j < n; j += 1) {7;          x = 7; // (1)8;        }9;        A[0] = x; // (3)10;      }11;      // (4)12;    }13 14; LICM:   Statements15 16target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"17 18define void @foo(i32 %n, ptr noalias nonnull %A, float %x) {19entry:20  %smax = call i32 @llvm.smax.i32(i32 %n, i32 0)21  br label %for.cond.1.preheader22 23for.cond.1.preheader:                             ; preds = %for.end, %entry24  %i.05 = phi i32 [ 0, %entry ], [ %add5, %for.end ]25  %x.addr.04 = phi float [ %x, %entry ], [ %x.addr.1.lcssa, %for.end ]26  br label %for.cond.127 28for.cond.1:                                       ; preds = %for.cond.1, %for.cond.1.preheader29  %x.addr.1 = phi float [ 7.000000e+00, %for.cond.1 ], [ %x.addr.04, %for.cond.1.preheader ]30  %j.0 = phi i32 [ %add, %for.cond.1 ], [ 0, %for.cond.1.preheader ]31  %add = add nuw i32 %j.0, 132  %exitcond.not = icmp eq i32 %j.0, %smax33  br i1 %exitcond.not, label %for.end, label %for.cond.134 35for.end:                                          ; preds = %for.cond.136  %x.addr.1.lcssa = phi float [ %x.addr.1, %for.cond.1 ]37  %add5 = add nuw nsw i32 %i.05, 138  %exitcond6.not = icmp eq i32 %add5, 539  br i1 %exitcond6.not, label %for.end.6, label %for.cond.1.preheader40 41for.end.6:                                        ; preds = %for.end42  %x.addr.1.lcssa.lcssa = phi float [ %x.addr.1.lcssa, %for.end ]43  store float %x.addr.1.lcssa.lcssa, ptr %A, align 444  ret void45}46 47; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)48declare i32 @llvm.smax.i32(i32, i32) #049 50attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }   51