brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.8 KiB · dd6115c Raw
56 lines · plain
1; RUN: opt %loadNPMPolly '-passes=polly-custom<scops>' -polly-print-scops -disable-output < %s 2>&1 | FileCheck %s2;3; Verify we do not generate an empty invalid context only because the wrap4; in the second conditional will always happen if the block is executed.5;6; CHECK:       Invalid Context:7; CHECK-NEXT:    [N] -> {  : N > 0 }8;9;    void f(char *A, char N) {10;      for (char i = 0; i < 10; i++) {11;        if (N > 0)12;          if (1 + 127 * N > 0)13;            A[i] = 1;14;        A[i] = 0;15;      }16;    }17;18target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"19 20define void @f(ptr %A, i8 signext %N) {21entry:22  br label %for.cond23 24for.cond:                                         ; preds = %for.inc, %entry25  %indvars.iv = phi i8 [ %indvars.iv.next, %for.inc ], [ 0, %entry ]26  %exitcond = icmp ne i8 %indvars.iv, 1027  br i1 %exitcond, label %for.body, label %for.end28 29for.body:                                         ; preds = %for.cond30  %cmp3 = icmp sgt i8 %N, 031  br i1 %cmp3, label %if.then, label %if.end1032 33if.then:                                           ; preds = %for.body34  %mul = mul i8 %N, 12735  %add = add i8 1, %mul36  %cmp7 = icmp sgt i8 %add, 037  br i1 %cmp7, label %if.then9, label %if.end1038 39if.then9:                                         ; preds = %if.end40  %arrayidx = getelementptr inbounds i8, ptr %A, i8 %indvars.iv41  store i8 1, ptr %arrayidx, align 142  br label %if.end1043 44if.end10:                                         ; preds = %if.then9, %if.end45  %arrayidx12 = getelementptr inbounds i8, ptr %A, i8 %indvars.iv46  store i8 0, ptr %arrayidx12, align 147  br label %for.inc48 49for.inc:                                          ; preds = %if.end10, %if.then50  %indvars.iv.next = add nuw nsw i8 %indvars.iv, 151  br label %for.cond52 53for.end:                                          ; preds = %for.cond54  ret void55}56