llvm-project
70 строк · 1.3 Кб
1; RUN: opt %loadNPMPolly -passes=polly-codegen -S < %s | FileCheck %s -check-prefix=CHECK-CODE
2
3; void f(long A[], long N) {
4; long i;
5;
6; if (true){
7; i = 0;
8; goto next;
9; }else{
10; i = 1;
11; goto next;
12; }
13;
14; next:
15; if (true)
16; goto for.i;
17; else
18; goto for.i;
19;
20; for.i:
21; for (i = 0; i < N; ++i)
22; A[i] = i;
23; }
24
25target 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"
26
27define void @f(ptr %A, i64 %N) nounwind {
28entry:
29fence seq_cst
30br i1 true, label %then1, label %else1
31
32then1:
33br label %next
34
35else1:
36br label %next
37
38next:
39%sg = getelementptr i64, ptr %A, i64 42
40store i64 undef, ptr %sg
41br i1 true, label %then, label %else
42
43then:
44br label %for.i.head
45
46else:
47br label %for.i.head
48
49for.i.head:
50br label %for.i.head1
51
52for.i.head1:
53br label %for.i
54
55for.i:
56%indvar = phi i64 [ 0, %for.i.head1], [ %indvar.next, %for.i ]
57fence seq_cst
58%scevgep = getelementptr i64, ptr %A, i64 %indvar
59store i64 %indvar, ptr %scevgep
60%indvar.next = add nsw i64 %indvar, 1
61%exitcond = icmp eq i64 %indvar.next, %N
62br i1 %exitcond, label %return, label %for.i
63
64return:
65fence seq_cst
66ret void
67}
68
69; CHECK-CODE: polly.split_new_and_old
70; CHECK-CODE: polly.merge_new_and_old
71