xref: /llvm-project/llvm/test/CodeGen/AMDGPU/lto-lower-module-lds.ll (revision 95a834a16c3de0de615d0cfa20a6c8bd973b6a1d)
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 poison, align 4
42
43define amdgpu_kernel void @test() {
44entry:
45  store i32 1, ptr addrspace(3) @lds
46  ret void
47}
48