1 ; RUN: opt %loadPolly -polly-print-scops -disable-output< %s | FileCheck %s
2 ; RUN: opt %loadPolly -polly-print-ast -disable-output < %s | FileCheck %s --check-prefix=AST
4 ; This only works after the post-dominator tree has fixed.
7 ; void exception() __attribute__((noreturn));
9 ; void foo(long n, float A[100]) {
10 ; for (long j = 0; j < n; j++) {
11 ; for (long i = j; i < n; i++) {
23 ; CHECK: Assumed Context:
24 ; CHECK: [n] -> { : n >= 101 }
26 ; AST: if (1 && 0 == n >= 101)
27 ; AST: for (int c0 = 0; c0 < n; c0 += 1)
28 ; AST: for (int c1 = 0; c1 < n - c0; c1 += 1)
29 ; AST: Stmt_if_end_7(c0, c1);
35 ; AST: { /* original code */ }
36 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
38 define void @foo(i64 %n, ptr %A) #0 {
42 for.cond: ; preds = %for.inc.8, %entry
43 %j.0 = phi i64 [ 0, %entry ], [ %inc9, %for.inc.8 ]
44 %cmp = icmp slt i64 %j.0, %n
45 br i1 %cmp, label %for.body, label %for.end.10
47 for.body: ; preds = %for.cond
50 for.cond.1: ; preds = %for.inc, %for.body
51 %i.0 = phi i64 [ %j.0, %for.body ], [ %inc, %for.inc ]
52 %cmp2 = icmp slt i64 %i.0, %n
53 br i1 %cmp2, label %for.body.3, label %for.end
55 for.body.3: ; preds = %for.cond.1
56 br i1 false, label %if.then, label %if.end
58 if.then: ; preds = %for.body.3
59 call void (...) @exception() #2
62 if.end: ; preds = %for.body.3
63 %cmp5 = icmp sgt i64 %i.0, 99
64 br i1 %cmp5, label %if.then.6, label %if.end.7
66 if.then.6: ; preds = %if.end
67 call void (...) @exception() #2
70 if.end.7: ; preds = %if.end
71 %conv = sitofp i64 %i.0 to float
72 %arrayidx = getelementptr inbounds float, ptr %A, i64 %i.0
73 %tmp = load float, ptr %arrayidx, align 4
74 %add = fadd float %tmp, %conv
75 store float %add, ptr %arrayidx, align 4
78 for.inc: ; preds = %if.end.7
79 %inc = add nuw nsw i64 %i.0, 1
82 for.end: ; preds = %for.cond.1
85 for.inc.8: ; preds = %for.end
86 %inc9 = add nuw nsw i64 %j.0, 1
89 for.end.10: ; preds = %for.cond
93 declare void @exception(...) #1
95 attributes #0 = { nounwind uwtable "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="all" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+sse,+sse2" "unsafe-fp-math"="false" "use-soft-float"="false" }
96 attributes #1 = { noreturn "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="all" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+sse,+sse2" "unsafe-fp-math"="false" "use-soft-float"="false" }
97 attributes #2 = { noreturn nounwind }
101 !0 = !{!"clang version 3.8.0 (trunk 246853)"}