xref: /llvm-project/polly/test/Support/defaultpipelines.ll (revision 15397583e3d85eb1f1a051de26eb409aaedd3b54)
1; RUN: opt %loadNPMPolly -polly -O0 -S < %s | FileCheck %s --check-prefix=CHECK --check-prefix=OFF
2; RUN: opt %loadNPMPolly -polly -O1 -S < %s | FileCheck %s --check-prefix=CHECK --check-prefix=ON
3; RUN: opt %loadNPMPolly -polly -O2 -S < %s | FileCheck %s --check-prefix=CHECK --check-prefix=ON
4; RUN: opt %loadNPMPolly -polly -O3 -S < %s | FileCheck %s --check-prefix=CHECK --check-prefix=ON
5; RUN: opt %loadNPMPolly -polly -Os -S < %s | FileCheck %s --check-prefix=CHECK --check-prefix=OFF
6; RUN: opt %loadNPMPolly -polly -Oz -S < %s | FileCheck %s --check-prefix=CHECK --check-prefix=OFF
7;
8; Check that Polly's default pipeline works from detection to code generation
9; with either pass manager.
10; The presence of the BB polly.stmt.body.lr.ph indicates that the statement
11; has been re-generated by Polly. It should not have been merged with other
12; BBs by SimplifyCFG.
13;
14; for (int j = 0; j < n; j += 1) {
15;   A[0] = 42.0;
16; }
17;
18define void @func(i32 %n, ptr noalias nonnull %A) {
19entry:
20  br label %for
21
22for:
23  %j = phi i32 [0, %entry], [%j.inc, %inc]
24  %j.cmp = icmp slt i32 %j, %n
25  br i1 %j.cmp, label %body, label %exit
26
27    body:
28      store double 42.0, ptr %A
29      br label %inc
30
31inc:
32  %j.inc = add nuw nsw i32 %j, 1
33  br label %for
34
35exit:
36  br label %return
37
38return:
39  ret void
40}
41
42
43; CHECK-LABEL: define void @func(
44; ON:       polly.stmt.body.lr.ph:
45; ON-NEXT:    store double 4.200000e+01, ptr %A, align 8
46; OFF-NOT:  polly
47