brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.6 KiB · a09bdaf Raw
48 lines · plain
1; RUN: opt %loadNPMPolly '-passes=polly-custom<scops>' -polly-print-scops -disable-output < %s 2>&1 | FileCheck %s2;3;    void f(int *A, int c, int d) {4;      for (int i = 0; i < 1024; i++)5;        if (c < i)6;          A[i]++;7;    }8;9; Verify that we do not generate a value write access for the use of %cmp1 in10; the branch condition. As _affine_ branches are fully modeled and regenerated11; from the polyhedral information we do not need this value to be available12; during code generation.13;14; CHECK-NOT:  Stmt_for_cond[i0] -> MemRef_cmp1[] }15;16target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"17 18define void @f(ptr %A, i64 %c) {19entry:20  br label %for.cond21 22for.cond:                                         ; preds = %for.inc, %entry23  %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ]24  %exitcond = icmp ne i64 %indvars.iv, 102425  %cmp1 = icmp slt i64 %c, %indvars.iv26  br i1 %exitcond, label %for.body, label %for.end27 28for.body:                                         ; preds = %for.cond29  br i1 %cmp1, label %if.then, label %if.end30 31if.then:                                          ; preds = %for.body32  %arrayidx = getelementptr inbounds i32, ptr %A, i64 %indvars.iv33  %tmp = load i32, ptr %arrayidx, align 434  %inc = add nsw i32 %tmp, 135  store i32 %inc, ptr %arrayidx, align 436  br label %if.end37 38if.end:                                           ; preds = %if.then, %for.body39  br label %for.inc40 41for.inc:                                          ; preds = %if.end42  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 143  br label %for.cond44 45for.end:                                          ; preds = %for.cond46  ret void47}48