1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 19:23:23 +01:00

[PowerPC] Miscellaneous fast-isel test cases.

Here are a few more tests that now pass after the recent fast-isel
commits.

llvm-svn: 189637
This commit is contained in:
Bill Schmidt 2013-08-30 02:43:08 +00:00
parent b3f46e50b4
commit 19810417cb
4 changed files with 131 additions and 0 deletions

View File

@ -0,0 +1,48 @@
; RUN: llc < %s -O0 -verify-machineinstrs -fast-isel-abort -mtriple=powerpc64-unknown-linux-gnu -mcpu=pwr7 | FileCheck %s --check-prefix=ELF64
%struct.A = type { i32, [2 x [2 x i32]], i8, [3 x [3 x [3 x i32]]] }
%struct.B = type { i32, [2 x [2 x [2 x %struct.A]]] }
@arr = common global [2 x [2 x [2 x [2 x [2 x i32]]]]] zeroinitializer, align 4
@A = common global [3 x [3 x %struct.A]] zeroinitializer, align 4
@B = common global [2 x [2 x [2 x %struct.B]]] zeroinitializer, align 4
define i32* @t1() nounwind {
entry:
; ELF64: t1
%addr = alloca i32*, align 4
store i32* getelementptr inbounds ([2 x [2 x [2 x [2 x [2 x i32]]]]]* @arr, i32 0, i32 1, i32 1, i32 1, i32 1, i32 1), i32** %addr, align 4
; ELF64: addi {{[0-9]+}}, {{[0-9]+}}, 124
%0 = load i32** %addr, align 4
ret i32* %0
}
define i32* @t2() nounwind {
entry:
; ELF64: t2
%addr = alloca i32*, align 4
store i32* getelementptr inbounds ([3 x [3 x %struct.A]]* @A, i32 0, i32 2, i32 2, i32 3, i32 1, i32 2, i32 2), i32** %addr, align 4
; ELF64: addi {{[0-9]+}}, {{[0-9]+}}, 1148
%0 = load i32** %addr, align 4
ret i32* %0
}
define i32* @t3() nounwind {
entry:
; ELF64: t3
%addr = alloca i32*, align 4
store i32* getelementptr inbounds ([3 x [3 x %struct.A]]* @A, i32 0, i32 0, i32 1, i32 1, i32 0, i32 1), i32** %addr, align 4
; ELF64: addi {{[0-9]+}}, {{[0-9]+}}, 140
%0 = load i32** %addr, align 4
ret i32* %0
}
define i32* @t4() nounwind {
entry:
; ELF64: t4
%addr = alloca i32*, align 4
store i32* getelementptr inbounds ([2 x [2 x [2 x %struct.B]]]* @B, i32 0, i32 0, i32 0, i32 1, i32 1, i32 0, i32 0, i32 1, i32 3, i32 1, i32 2, i32 1), i32** %addr, align 4
; ELF64: addi {{[0-9]+}}, {{[0-9]+}}, 1284
%0 = load i32** %addr, align 4
ret i32* %0
}

View File

@ -0,0 +1,23 @@
; RUN: llc < %s -O0 -verify-machineinstrs -fast-isel-abort -mtriple=powerpc64-unknown-linux-gnu -mcpu=pwr7
; Ensure this doesn't crash.
%union.anon = type { <16 x i32> }
@__md0 = external global [137 x i8]
define internal void @stretch(<4 x i8> addrspace(1)* %src, <4 x i8> addrspace(1)* %dst, i32 %width, i32 %height, i32 %iLS, i32 %oLS, <2 x float> %c, <4 x float> %param) nounwind {
entry:
ret void
}
define internal i32 @_Z13get_global_idj(i32 %dim) nounwind ssp {
entry:
ret i32 undef
}
define void @wrap(i8 addrspace(1)* addrspace(1)* %arglist, i32 addrspace(1)* %gtid) nounwind ssp {
entry:
call void @stretch(<4 x i8> addrspace(1)* undef, <4 x i8> addrspace(1)* undef, i32 undef, i32 undef, i32 undef, i32 undef, <2 x float> undef, <4 x float> undef)
ret void
}

View File

@ -0,0 +1,10 @@
; RUN: llc -O0 -verify-machineinstrs -fast-isel-abort -optimize-regalloc -regalloc=basic -mtriple=powerpc64-unknown-linux-gnu -mcpu=pwr7 < %s
; This isn't exactly a useful set of command-line options, but check that it
; doesn't crash. (It crashed formerly on ARM, and proved useful in
; discovering a bug on PowerPC as well.)
define i32 @f(i32* %x) nounwind ssp {
%y = getelementptr inbounds i32* %x, i32 5000
%tmp103 = load i32* %y, align 4
ret i32 %tmp103
}

View File

@ -0,0 +1,50 @@
; RUN: llc < %s -O0 -verify-machineinstrs -fast-isel-abort -mtriple=powerpc64-unknown-linux-gnu -mcpu=pwr7 | FileCheck %s --check-prefix=ELF64
define i32 @shl() nounwind ssp {
entry:
; ELF64: shl
; ELF64: slw
%shl = shl i32 -1, 2
ret i32 %shl
}
define i32 @shl_reg(i32 %src1, i32 %src2) nounwind ssp {
entry:
; ELF64: shl_reg
; ELF64: slw
%shl = shl i32 %src1, %src2
ret i32 %shl
}
define i32 @lshr() nounwind ssp {
entry:
; ELF64: lshr
; ELF64: srw
%lshr = lshr i32 -1, 2
ret i32 %lshr
}
define i32 @lshr_reg(i32 %src1, i32 %src2) nounwind ssp {
entry:
; ELF64: lshr_reg
; ELF64: srw
%lshr = lshr i32 %src1, %src2
ret i32 %lshr
}
define i32 @ashr() nounwind ssp {
entry:
; ELF64: ashr
; ELF64: srawi
%ashr = ashr i32 -1, 2
ret i32 %ashr
}
define i32 @ashr_reg(i32 %src1, i32 %src2) nounwind ssp {
entry:
; ELF64: ashr_reg
; ELF64: sraw
%ashr = ashr i32 %src1, %src2
ret i32 %ashr
}