Update Polly tests to handle explicitly typed gep changes in LLVM
[polly-mirror.git] / test / Isl / CodeGen / loop_with_conditional_entry_edge_splited_hard_case.ll
blob612b0f38933b6029d71448c3b47b7de45415857a
1 ; RUN: opt %loadPolly -polly-detect-unprofitable -polly-no-early-exit -polly-codegen-isl -S < %s | FileCheck %s
3 ; Test case to trigger the hard way of creating a unique entering
4 ; edge for the SCoP. It is triggered because the entering edge
5 ; here: %while.begin --> %if is __not__ critical.
7 ;    int f(void);
8 ;    void jd(int b, int *A) {
9 ;      while (f()) {
10 ;        if (b)
11 ;          for (int i = 0; i < 1024; i++)
12 ;            A[i] = i;
13 ;      }
14 ;    }
16 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
18 define void @jd(i32 %b, i32* %A) {
19 entry:
20   br label %while.begin
22 ; CHECK: while.begin:
23 while.begin:
24 ; CHECK:  %call = call i32 @f()
25   %call = call i32 @f()
26 ; CHECK:  %tobool = icmp eq i32 %call, 0
27   %tobool = icmp eq i32 %call, 0
28 ; CHECK:  br i1 %tobool, label %while.end, label %polly.entering.block
29   br i1 %tobool, label %while.end, label %if
31 ; CHECK: polly.entering.block:
32 ; CHECK:   br label %polly.split_new_and_old
34 ; CHECK: polly.split_new_and_old:
35 ; CHECK:   br i1 true, label %polly.start, label %if.split
37 ; CHECK: if.split:
38 if:                                               ; preds = %while.begin
39 ; CHECK: %tobool2 = icmp eq i32 %b, 0
40   %tobool2 = icmp eq i32 %b, 0
41 ; CHECK: br i1 %tobool2, label %while.begin{{[a-zA-Z._]*}}, label %for.cond
42   br i1 %tobool2, label %while.begin, label %for.cond
44 for.cond:                                         ; preds = %for.inc, %if
45   %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %if ]
46   %exitcond = icmp ne i64 %indvars.iv, 1024
47   br i1 %exitcond, label %for.body, label %while.begin
49 for.body:                                         ; preds = %for.cond
50   %arrayidx = getelementptr inbounds i32, i32* %A, i64 %indvars.iv
51   %tmp = trunc i64 %indvars.iv to i32
52   store i32 %tmp, i32* %arrayidx, align 4
53   br label %for.inc
55 for.inc:                                          ; preds = %for.body
56   %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
57   br label %for.cond
59 while.end:                                        ; preds = %entry, %for.cond
60   ret void
63 declare i32 @f()