llvm-project
45 строк · 1.8 Кб
1; RUN: opt %loadNPMPolly \
2; RUN: -passes=polly-codegen -S < %s | FileCheck %s
3
4; This test cases used to crash the scalar code generation. Check that we
5; can generate code for it.
6
7; CHECK: polly.start
8@endposition = external global i32, align 4
9@Bit = external global [0 x i32], align 4
10@Init = external global [0 x i32], align 4
11
12define void @maskgen() {
13entry:
14br label %for.body
15
16for.body: ; preds = %for.body, %entry
17br i1 undef, label %for.end.310, label %for.body
18
19for.end.310: ; preds = %for.body
20store i32 undef, ptr @endposition, align 4
21%sub325 = sub i32 33, 0
22%0 = load i32, ptr @Init, align 4
23br i1 false, label %for.cond.347.preheader, label %for.body.328.lr.ph
24
25for.body.328.lr.ph: ; preds = %for.end.310
26%1 = sub i32 34, 0
27br label %for.body.328
28
29for.body.328: ; preds = %for.body.328, %for.body.328.lr.ph
30%indvars.iv546 = phi i64 [ %indvars.iv.next547, %for.body.328 ], [ 1, %for.body.328.lr.ph ]
31%2 = phi i32 [ %or331, %for.body.328 ], [ %0, %for.body.328.lr.ph ]
32%arrayidx330 = getelementptr inbounds [0 x i32], ptr @Bit, i64 0, i64 %indvars.iv546
33%3 = load i32, ptr %arrayidx330, align 4
34%or331 = or i32 %3, %2
35%indvars.iv.next547 = add nuw nsw i64 %indvars.iv546, 1
36%lftr.wideiv = trunc i64 %indvars.iv.next547 to i32
37%exitcond14 = icmp eq i32 %lftr.wideiv, %1
38br i1 %exitcond14, label %for.cond.347.preheader, label %for.body.328
39
40for.cond.347.preheader: ; preds = %for.cond.347.preheader, %for.body.328, %for.end.310
41br i1 undef, label %if.end.471, label %for.cond.347.preheader
42
43if.end.471: ; preds = %for.cond.347.preheader
44ret void
45}
46