mirror of
https://github.com/RPCS3/llvm.git
synced 2024-12-16 16:37:42 +00:00
R600: Add some testcases for promote alloca pass.
More complicated GEPs are skipped. Add some tests to actually stress this skipping. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211859 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
ed4589dc16
commit
88a3c72e25
@ -1,6 +1,8 @@
|
||||
; RUN: llc -march=r600 -mcpu=redwood < %s | FileCheck %s --check-prefix=R600-CHECK --check-prefix=FUNC
|
||||
; RUN: llc -verify-machineinstrs -march=r600 -mcpu=SI < %s | FileCheck %s --check-prefix=SI-CHECK --check-prefix=FUNC
|
||||
|
||||
declare i32 @llvm.r600.read.tidig.x() nounwind readnone
|
||||
|
||||
; FUNC-LABEL: @mova_same_clause
|
||||
|
||||
; R600-CHECK: LDS_WRITE
|
||||
@ -199,6 +201,71 @@ entry:
|
||||
ret void
|
||||
}
|
||||
|
||||
define void @char_array_array(i32 addrspace(1)* %out, i32 %index) {
|
||||
entry:
|
||||
%alloca = alloca [2 x [2 x i8]]
|
||||
%gep0 = getelementptr [2 x [2 x i8]]* %alloca, i32 0, i32 0, i32 0
|
||||
%gep1 = getelementptr [2 x [2 x i8]]* %alloca, i32 0, i32 0, i32 1
|
||||
store i8 0, i8* %gep0
|
||||
store i8 1, i8* %gep1
|
||||
%gep2 = getelementptr [2 x [2 x i8]]* %alloca, i32 0, i32 0, i32 %index
|
||||
%load = load i8* %gep2
|
||||
%sext = sext i8 %load to i32
|
||||
store i32 %sext, i32 addrspace(1)* %out
|
||||
ret void
|
||||
}
|
||||
|
||||
define void @i32_array_array(i32 addrspace(1)* %out, i32 %index) {
|
||||
entry:
|
||||
%alloca = alloca [2 x [2 x i32]]
|
||||
%gep0 = getelementptr [2 x [2 x i32]]* %alloca, i32 0, i32 0, i32 0
|
||||
%gep1 = getelementptr [2 x [2 x i32]]* %alloca, i32 0, i32 0, i32 1
|
||||
store i32 0, i32* %gep0
|
||||
store i32 1, i32* %gep1
|
||||
%gep2 = getelementptr [2 x [2 x i32]]* %alloca, i32 0, i32 0, i32 %index
|
||||
%load = load i32* %gep2
|
||||
store i32 %load, i32 addrspace(1)* %out
|
||||
ret void
|
||||
}
|
||||
|
||||
declare i32 @llvm.r600.read.tidig.x() nounwind readnone
|
||||
define void @i64_array_array(i64 addrspace(1)* %out, i32 %index) {
|
||||
entry:
|
||||
%alloca = alloca [2 x [2 x i64]]
|
||||
%gep0 = getelementptr [2 x [2 x i64]]* %alloca, i32 0, i32 0, i32 0
|
||||
%gep1 = getelementptr [2 x [2 x i64]]* %alloca, i32 0, i32 0, i32 1
|
||||
store i64 0, i64* %gep0
|
||||
store i64 1, i64* %gep1
|
||||
%gep2 = getelementptr [2 x [2 x i64]]* %alloca, i32 0, i32 0, i32 %index
|
||||
%load = load i64* %gep2
|
||||
store i64 %load, i64 addrspace(1)* %out
|
||||
ret void
|
||||
}
|
||||
|
||||
%struct.pair32 = type { i32, i32 }
|
||||
|
||||
define void @struct_array_array(i32 addrspace(1)* %out, i32 %index) {
|
||||
entry:
|
||||
%alloca = alloca [2 x [2 x %struct.pair32]]
|
||||
%gep0 = getelementptr [2 x [2 x %struct.pair32]]* %alloca, i32 0, i32 0, i32 0, i32 1
|
||||
%gep1 = getelementptr [2 x [2 x %struct.pair32]]* %alloca, i32 0, i32 0, i32 1, i32 1
|
||||
store i32 0, i32* %gep0
|
||||
store i32 1, i32* %gep1
|
||||
%gep2 = getelementptr [2 x [2 x %struct.pair32]]* %alloca, i32 0, i32 0, i32 %index, i32 0
|
||||
%load = load i32* %gep2
|
||||
store i32 %load, i32 addrspace(1)* %out
|
||||
ret void
|
||||
}
|
||||
|
||||
define void @struct_pair32_array(i32 addrspace(1)* %out, i32 %index) {
|
||||
entry:
|
||||
%alloca = alloca [2 x %struct.pair32]
|
||||
%gep0 = getelementptr [2 x %struct.pair32]* %alloca, i32 0, i32 0, i32 1
|
||||
%gep1 = getelementptr [2 x %struct.pair32]* %alloca, i32 0, i32 1, i32 0
|
||||
store i32 0, i32* %gep0
|
||||
store i32 1, i32* %gep1
|
||||
%gep2 = getelementptr [2 x %struct.pair32]* %alloca, i32 0, i32 %index, i32 0
|
||||
%load = load i32* %gep2
|
||||
store i32 %load, i32 addrspace(1)* %out
|
||||
ret void
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user