Skip to content

Commit a7f1081

Browse files
committed
add lto pipeline test
1 parent 8f84137 commit a7f1081

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
2+
; Default O0
3+
; RUN: opt -mtriple=amdgcn-- -mcpu=gfx1030 %s -o %t.bc
4+
; RUN: llvm-lto2 run -O0 -cg-opt-level 0 %t.bc -o %t.s -r %t.bc,test,px -debug-pass-manager -debug-pass=Structure 2>&1 | FileCheck %s
5+
6+
; Unified O0
7+
; RUN: opt -unified-lto -thinlto-split-lto-unit -thinlto-bc -mtriple=amdgcn-- -mcpu=gfx1030 %s -o %t.bc
8+
; RUN: llvm-lto2 run -unified-lto=full -O0 -cg-opt-level 0 %t.bc -o %t.s -r %t.bc,test,px -debug-pass-manager -debug-pass=Structure 2>&1 | FileCheck %s
9+
10+
; Default O1
11+
; RUN: opt -mtriple=amdgcn-- -mcpu=gfx1030 %s -o %t.bc
12+
; RUN: llvm-lto2 run -O1 -cg-opt-level 1 %t.bc -o %t.s -r %t.bc,test,px -debug-pass-manager -debug-pass=Structure 2>&1 | FileCheck %s
13+
14+
; Unified O1
15+
; RUN: opt -unified-lto -thinlto-split-lto-unit -thinlto-bc -mtriple=amdgcn-- -mcpu=gfx1030 %s -o %t.bc
16+
; RUN: llvm-lto2 run -unified-lto=full -O1 -cg-opt-level 1 %t.bc -o %t.s -r %t.bc,test,px -debug-pass-manager -debug-pass=Structure 2>&1 | FileCheck %s
17+
18+
; Default O2
19+
; RUN: opt -mtriple=amdgcn-- -mcpu=gfx1030 %s -o %t.bc
20+
; RUN: llvm-lto2 run -O2 -cg-opt-level 2 %t.bc -o %t.s -r %t.bc,test,px -debug-pass-manager -debug-pass=Structure 2>&1 | FileCheck %s
21+
22+
; Unified O2
23+
; RUN: opt -unified-lto -thinlto-split-lto-unit -thinlto-bc -mtriple=amdgcn-- -mcpu=gfx1030 %s -o %t.bc
24+
; RUN: llvm-lto2 run -unified-lto=full -O2 -cg-opt-level 2 %t.bc -o %t.s -r %t.bc,test,px -debug-pass-manager -debug-pass=Structure 2>&1 | FileCheck %s
25+
26+
; Default O3
27+
; RUN: opt -mtriple=amdgcn-- -mcpu=gfx1030 %s -o %t.bc
28+
; RUN: llvm-lto2 run -O3 -cg-opt-level 3 %t.bc -o %t.s -r %t.bc,test,px -debug-pass-manager -debug-pass=Structure 2>&1 | FileCheck %s
29+
30+
; Unified O3
31+
; RUN: opt -unified-lto -thinlto-split-lto-unit -thinlto-bc -mtriple=amdgcn-- -mcpu=gfx1030 %s -o %t.bc
32+
; RUN: llvm-lto2 run -unified-lto=full -O3 -cg-opt-level 3 %t.bc -o %t.s -r %t.bc,test,px -debug-pass-manager -debug-pass=Structure 2>&1 | FileCheck %s
33+
34+
; First print will be from the New PM during the full LTO pipeline.
35+
; Second print will be from the legacy PM during the CG pipeline.
36+
37+
; CHECK: Running pass: AMDGPULowerModuleLDSPass on [module]
38+
; CHECK: ModulePass Manager
39+
; CHECK: Lower uses of LDS variables from non-kernel functions
40+
41+
@lds = internal unnamed_addr addrspace(3) global i32 undef, align 4
42+
43+
define amdgpu_kernel void @test() {
44+
entry:
45+
store i32 1, ptr addrspace(3) @lds
46+
ret void
47+
}

0 commit comments

Comments
 (0)