Add forgotten Makefile
[polly.git] / test / ScopInfo / bad_loop_1.ll
blobe5421e09c5753707f8bed78f9bfdc0c0f143ee52
1 ; RUN: opt %loadPolly %defaultOpts  -polly-analyze-ir  -analyze %s | FileCheck %s -check-prefix=INDVAR
2 ; RUN: opt %loadPolly %defaultOpts -polly-analyze-ir  -analyze %s | FileCheck %s
4 ;void f(long a[][128], long N, long M) {
5 ;  long i, j;
6 ;  for (j = 0; j < rnd(); ++j)
7 ;    for (i = 0; i < N; ++i)
8 ;        a[i][j] = 0;
9 ;}
11 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128"
12 target triple = "x86_64-unknown-linux-gnu"
14 define void @f([128 x i64]* nocapture %a, i64 %N, i64 %M) nounwind {
15 entry:
16   %0 = tail call i64 (...)* @rnd() nounwind       ; <i64> [#uses=1]
17   %1 = icmp sgt i64 %0, 0                         ; <i1> [#uses=1]
18   br i1 %1, label %bb.nph8, label %return
20 bb.nph8:                                          ; preds = %entry
21   %2 = icmp sgt i64 %N, 0                         ; <i1> [#uses=1]
22   br i1 %2, label %bb2.preheader.us, label %bb2.preheader
24 bb2.preheader.us:                                 ; preds = %bb2.bb3_crit_edge.us, %bb.nph8
25   %3 = phi i64 [ 0, %bb.nph8 ], [ %tmp, %bb2.bb3_crit_edge.us ] ; <i64> [#uses=2]
26   %tmp = add i64 %3, 1                            ; <i64> [#uses=2]
27   br label %bb1.us
29 bb1.us:                                           ; preds = %bb1.us, %bb2.preheader.us
30   %i.06.us = phi i64 [ 0, %bb2.preheader.us ], [ %4, %bb1.us ] ; <i64> [#uses=2]
31   %scevgep = getelementptr [128 x i64]* %a, i64 %i.06.us, i64 %3 ; <i64*> [#uses=1]
32   store i64 0, i64* %scevgep, align 8
33   %4 = add nsw i64 %i.06.us, 1                    ; <i64> [#uses=2]
34   %exitcond = icmp eq i64 %4, %N                  ; <i1> [#uses=1]
35   br i1 %exitcond, label %bb2.bb3_crit_edge.us, label %bb1.us
37 bb2.bb3_crit_edge.us:                             ; preds = %bb1.us
38   %5 = tail call i64 (...)* @rnd() nounwind       ; <i64> [#uses=1]
39   %6 = icmp sgt i64 %5, %tmp                      ; <i1> [#uses=1]
40   br i1 %6, label %bb2.preheader.us, label %return
42 bb2.preheader:                                    ; preds = %bb2.preheader, %bb.nph8
43   %j.07 = phi i64 [ %tmp9, %bb2.preheader ], [ 0, %bb.nph8 ] ; <i64> [#uses=1]
44   %tmp9 = add i64 %j.07, 1                        ; <i64> [#uses=2]
45   %7 = tail call i64 (...)* @rnd() nounwind       ; <i64> [#uses=1]
46   %8 = icmp sgt i64 %7, %tmp9                     ; <i1> [#uses=1]
47   br i1 %8, label %bb2.preheader, label %return
49 return:                                           ; preds = %bb2.preheader, %bb2.bb3_crit_edge.us, %entry
50   ret void
53 declare i64 @rnd(...)
55 ; INDVAR: Scop: bb1.us => bb2.bb3_crit_edge.us Parameters: (%N, {0,+,1}<%bb2.preheader.us>, ), Max Loop Depth: 1
56 ; CHECK: Scop: bb1.us => bb2.bb3_crit_edge.us Parameters: (%N, {0,+,1}<%bb2.preheader.us>, ), Max Loop Depth: 1