Skip to content

Commit 089421b

Browse files
committed
[Polly] Test all optimization levels.
1 parent d5adba1 commit 089421b

File tree

2 files changed

+55
-41
lines changed

2 files changed

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

polly/test/Support/passmanager-O3.ll

Lines changed: 0 additions & 41 deletions
This file was deleted.

0 commit comments

Comments
 (0)