xref: /llvm-project/polly/test/CodeGen/multiple-scops-in-a-row.ll (revision 5aafc6d58f3405662902cee006be11e599801b88)
1; RUN: opt %loadNPMPolly -S -passes=polly-codegen < %s | FileCheck %s
2
3; This test case has two scops in a row. When code generating the first scop,
4; the second scop is invalidated. This test case verifies that we do not crash
5; due to incorrectly assuming the second scop is still valid.
6
7; We explicitly check here that the second scop is not code generated. Later
8; improvements may make this possible (e.g., Polly gaining support for
9; parametric conditional expressions or a changed code generation order).
10; However, in case this happens, we want to ensure this test case is been
11; reasoned about and updated accordingly.
12
13; CHECK: polly.start:
14; CHECK-NOT: polly.start:
15
16target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
17
18define void @hoge(ptr %arg) {
19bb:
20  br label %bb1
21
22bb1:                                              ; preds = %bb
23  %tmp = getelementptr inbounds i8, ptr %arg, i64 5
24  %tmp2 = getelementptr inbounds i8, ptr %arg, i64 6
25  br i1 false, label %bb3, label %bb4
26
27bb3:                                              ; preds = %bb1
28  br label %bb4
29
30bb4:                                              ; preds = %bb3, %bb1
31  %tmp5 = icmp eq i32 0, 1
32  br label %bb6
33
34bb6:                                              ; preds = %bb4
35  br i1 undef, label %bb7, label %bb8
36
37bb7:                                              ; preds = %bb6
38  unreachable
39
40bb8:                                              ; preds = %bb6
41  br i1 %tmp5, label %bb9, label %bb10
42
43bb9:                                              ; preds = %bb8
44  br label %bb11
45
46bb10:                                             ; preds = %bb8
47  br label %bb11
48
49bb11:                                             ; preds = %bb10, %bb9
50  ret void
51}
52