diff options
author | Scott Michel <scottm@aero.org> | 2008-01-29 02:16:57 +0000 |
---|---|---|
committer | Scott Michel <scottm@aero.org> | 2008-01-29 02:16:57 +0000 |
commit | f9f42e669b14d06c63414e1c1ceff36e621c0ddd (patch) | |
tree | 854873d70add745f12cb6df24494fbf9cca027c4 /test/CodeGen | |
parent | d92ed9099a22f8adb651c3413b6ac3a8e035c474 (diff) | |
download | external_llvm-f9f42e669b14d06c63414e1c1ceff36e621c0ddd.zip external_llvm-f9f42e669b14d06c63414e1c1ceff36e621c0ddd.tar.gz external_llvm-f9f42e669b14d06c63414e1c1ceff36e621c0ddd.tar.bz2 |
Overhaul Cell SPU's addressing mode internals so that there are now
only two addressing mode nodes, SPUaform and SPUindirect (vice the
three previous ones, SPUaform, SPUdform and SPUxform). This improves
code somewhat because we now avoid using reg+reg addressing when
it can be avoided. It also simplifies the address selection logic,
which was the main point for doing this.
Also, for various global variables that would be loaded using SPU's
A-form addressing, prefer D-form offs[reg] addressing, keeping the
base in a register if the variable is used more than once.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46483 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen')
-rw-r--r-- | test/CodeGen/CellSPU/call_indirect.ll | 15 | ||||
-rw-r--r-- | test/CodeGen/CellSPU/extract_elt.ll | 2 | ||||
-rw-r--r-- | test/CodeGen/CellSPU/fcmp.ll | 2 | ||||
-rw-r--r-- | test/CodeGen/CellSPU/struct_1.ll | 123 | ||||
-rw-r--r-- | test/CodeGen/CellSPU/struct_2.ll | 122 | ||||
-rw-r--r-- | test/CodeGen/CellSPU/vec_const.ll | 9 |
6 files changed, 79 insertions, 194 deletions
diff --git a/test/CodeGen/CellSPU/call_indirect.ll b/test/CodeGen/CellSPU/call_indirect.ll index f604f74..11481ed 100644 --- a/test/CodeGen/CellSPU/call_indirect.ll +++ b/test/CodeGen/CellSPU/call_indirect.ll @@ -1,19 +1,18 @@ ; RUN: llvm-as -o - %s | llc -march=cellspu > %t1.s ; RUN: llvm-as -o - %s | llc -march=cellspu -mattr=large_mem > %t2.s -; RUN: grep bisl %t1.s | count 7 +; RUN: grep bisl %t1.s | count 7 ; RUN: grep ila %t1.s | count 1 ; RUN: grep rotqbyi %t1.s | count 4 -; RUN: grep lqa %t1.s | count 5 -; RUN: grep lqd %t1.s | count 6 -; RUN: grep dispatch_tab %t1.s | count 10 +; RUN: grep lqa %t1.s | count 1 +; RUN: grep lqd %t1.s | count 11 +; RUN: grep dispatch_tab %t1.s | count 6 ; RUN: grep bisl %t2.s | count 7 ; RUN: grep ilhu %t2.s | count 2 ; RUN: grep iohl %t2.s | count 2 ; RUN: grep rotqby %t2.s | count 6 -; RUN: grep lqd %t2.s | count 12 -; RUN: grep lqx %t2.s | count 8 -; RUN: grep il %t2.s | count 9 -; RUN: grep ai %t2.s | count 5 +; RUN: grep lqd %t2.s | count 17 +; RUN: grep il %t2.s | count 2 +; RUN: grep ai %t2.s | count 7 ; RUN: grep dispatch_tab %t2.s | count 7 ; ModuleID = 'call_indirect.bc' diff --git a/test/CodeGen/CellSPU/extract_elt.ll b/test/CodeGen/CellSPU/extract_elt.ll index baa23bb..6e05686 100644 --- a/test/CodeGen/CellSPU/extract_elt.ll +++ b/test/CodeGen/CellSPU/extract_elt.ll @@ -2,7 +2,7 @@ ; RUN: llvm-as -o - %s | llc -march=cellspu -mattr=large_mem > %t2.s ; RUN: grep shufb %t1.s | count 27 ; RUN: grep lqa %t1.s | count 27 -; RUN: grep lqx %t2.s | count 27 +; RUN: grep lqd %t2.s | count 27 ; RUN: grep space %t1.s | count 8 ; RUN: grep byte %t1.s | count 424 target datalayout = "E-p:32:32:128-f64:64:128-f32:32:128-i64:32:128-i32:32:128-i16:16:128-i8:8:128-i1:8:128-a0:0:128-v128:128:128-s0:128:128" diff --git a/test/CodeGen/CellSPU/fcmp.ll b/test/CodeGen/CellSPU/fcmp.ll index f4406d6..d212bd5 100644 --- a/test/CodeGen/CellSPU/fcmp.ll +++ b/test/CodeGen/CellSPU/fcmp.ll @@ -1,5 +1,5 @@ ; RUN: llvm-as -o - %s | llc -march=cellspu > %t1.s -; RUN: grep fceq %t1.s | count 1 && +; RUN: grep fceq %t1.s | count 1 ; RUN: grep fcmeq %t1.s | count 1 ; ; This file includes standard floating point arithmetic instructions diff --git a/test/CodeGen/CellSPU/struct_1.ll b/test/CodeGen/CellSPU/struct_1.ll index e5fa79e..5d6daa2 100644 --- a/test/CodeGen/CellSPU/struct_1.ll +++ b/test/CodeGen/CellSPU/struct_1.ll @@ -1,27 +1,26 @@ ; RUN: llvm-as -o - %s | llc -march=cellspu > %t1.s ; RUN: llvm-as -o - %s | llc -march=cellspu -mattr=large_mem > %t2.s -; RUN: grep lqa %t1.s | count 10 -; RUN: grep lqd %t1.s | count 4 -; RUN: grep rotqbyi %t1.s | count 5 +; RUN: grep lqa %t1.s | count 5 +; RUN: grep lqd %t1.s | count 11 +; RUN: grep rotqbyi %t1.s | count 7 ; RUN: grep xshw %t1.s | count 1 -; RUN: grep andi %t1.s | count 4 +; RUN: grep andi %t1.s | count 5 ; RUN: grep cbd %t1.s | count 3 ; RUN: grep chd %t1.s | count 1 ; RUN: grep cwd %t1.s | count 3 ; RUN: grep shufb %t1.s | count 7 -; RUN: grep stqa %t1.s | count 5 -; RUN: grep iohl %t2.s | count 14 -; RUN: grep ilhu %t2.s | count 14 -; RUN: grep lqx %t2.s | count 14 -; RUN: grep rotqbyi %t2.s | count 5 +; RUN: grep stqd %t1.s | count 7 +; RUN: grep iohl %t2.s | count 16 +; RUN: grep ilhu %t2.s | count 16 +; RUN: grep lqd %t2.s | count 16 +; RUN: grep rotqbyi %t2.s | count 7 ; RUN: grep xshw %t2.s | count 1 -; RUN: grep andi %t2.s | count 4 -; RUN: grep cbx %t2.s | count 3 -; RUN: grep chx %t2.s | count 1 -; RUN: grep cwx %t2.s | count 1 -; RUN: grep cwd %t2.s | count 2 +; RUN: grep andi %t2.s | count 5 +; RUN: grep cbd %t2.s | count 3 +; RUN: grep chd %t2.s | count 1 +; RUN: grep cwd %t2.s | count 3 ; RUN: grep shufb %t2.s | count 7 -; RUN: grep stqx %t2.s | count 7 +; RUN: grep stqd %t2.s | count 7 ; ModuleID = 'struct_1.bc' target datalayout = "E-p:32:32:128-f64:64:128-f32:32:128-i64:32:128-i32:32:128-i16:16:128-i8:8:128-i1:8:128-a0:0:128-v128:128:128-s0:128:128" @@ -48,88 +47,98 @@ target triple = "spu" ; struct hackstate state = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } @state = global %struct.hackstate zeroinitializer, align 16 -define i8 @get_hackstate_c1() zeroext { +define i8 @get_hackstate_c1() zeroext nounwind { entry: - %tmp2 = load i8* getelementptr (%struct.hackstate* @state, i32 0, i32 0), align 16 - ret i8 %tmp2 + %tmp2 = load i8* getelementptr (%struct.hackstate* @state, i32 0, i32 0), align 16 + ret i8 %tmp2 } -define i8 @get_hackstate_c2() zeroext { +define i8 @get_hackstate_c2() zeroext nounwind { entry: - %tmp2 = load i8* getelementptr (%struct.hackstate* @state, i32 0, i32 1), align 16 - ret i8 %tmp2 + %tmp2 = load i8* getelementptr (%struct.hackstate* @state, i32 0, i32 1), align 16 + ret i8 %tmp2 } -define i8 @get_hackstate_c3() zeroext { +define i8 @get_hackstate_c3() zeroext nounwind { entry: - %tmp2 = load i8* getelementptr (%struct.hackstate* @state, i32 0, i32 2), align 16 - ret i8 %tmp2 + %tmp2 = load i8* getelementptr (%struct.hackstate* @state, i32 0, i32 2), align 16 + ret i8 %tmp2 } -define i32 @get_hackstate_i1() { +define i32 @get_hackstate_i1() nounwind { entry: - %tmp2 = load i32* getelementptr (%struct.hackstate* @state, i32 0, i32 3), align 16 - ret i32 %tmp2 + %tmp2 = load i32* getelementptr (%struct.hackstate* @state, i32 0, i32 3), align 16 + ret i32 %tmp2 } -define i16 @get_hackstate_s1() signext { +define i16 @get_hackstate_s1() signext nounwind { entry: - %tmp2 = load i16* getelementptr (%struct.hackstate* @state, i32 0, i32 4), align 16 - ret i16 %tmp2 + %tmp2 = load i16* getelementptr (%struct.hackstate* @state, i32 0, i32 4), align 16 + ret i16 %tmp2 } -define i8 @get_hackstate_c7() zeroext { +define i8 @get_hackstate_c6() zeroext nounwind { entry: - %tmp2 = load i8* getelementptr (%struct.hackstate* @state, i32 0, i32 9), align 16 - ret i8 %tmp2 + %tmp2 = load i8* getelementptr (%struct.hackstate* @state, i32 0, i32 8), align 16 + ret i8 %tmp2 } -define i32 @get_hackstate_i6() zeroext { +define i8 @get_hackstate_c7() zeroext nounwind { entry: - %tmp2 = load i32* getelementptr (%struct.hackstate* @state, i32 0, i32 13), align 16 - ret i32 %tmp2 + %tmp2 = load i8* getelementptr (%struct.hackstate* @state, i32 0, i32 9), align 16 + ret i8 %tmp2 } -define void @set_hackstate_c1(i8 zeroext %c) { +define i32 @get_hackstate_i3() nounwind { entry: - store i8 %c, i8* getelementptr (%struct.hackstate* @state, i32 0, i32 0), align 16 - ret void + %tmp2 = load i32* getelementptr (%struct.hackstate* @state, i32 0, i32 10), align 16 + ret i32 %tmp2 } -define void @set_hackstate_c2(i8 zeroext %c) { +define i32 @get_hackstate_i6() nounwind { entry: - store i8 %c, i8* getelementptr (%struct.hackstate* @state, i32 0, i32 1), align 16 - ret void + %tmp2 = load i32* getelementptr (%struct.hackstate* @state, i32 0, i32 13), align 16 + ret i32 %tmp2 } -define void @set_hackstate_c3(i8 zeroext %c) { +define void @set_hackstate_c1(i8 zeroext %c) nounwind { entry: - store i8 %c, i8* getelementptr (%struct.hackstate* @state, i32 0, i32 2), align 16 - ret void + store i8 %c, i8* getelementptr (%struct.hackstate* @state, i32 0, i32 0), align 16 + ret void } -define void @set_hackstate_i1(i32 %i) { +define void @set_hackstate_c2(i8 zeroext %c) nounwind { entry: - store i32 %i, i32* getelementptr (%struct.hackstate* @state, i32 0, i32 3), align 16 - ret void + store i8 %c, i8* getelementptr (%struct.hackstate* @state, i32 0, i32 1), align 16 + ret void } -define void @set_hackstate_s1(i16 signext %s) { +define void @set_hackstate_c3(i8 zeroext %c) nounwind { entry: - store i16 %s, i16* getelementptr (%struct.hackstate* @state, i32 0, i32 4), align 16 - ret void + store i8 %c, i8* getelementptr (%struct.hackstate* @state, i32 0, i32 2), align 16 + ret void } -define void @set_hackstate_i3(i32 %i) { +define void @set_hackstate_i1(i32 %i) nounwind { entry: - store i32 %i, i32* getelementptr (%struct.hackstate* @state, i32 0, i32 11), align 16 - ret void + store i32 %i, i32* getelementptr (%struct.hackstate* @state, i32 0, i32 3), align 16 + ret void } +define void @set_hackstate_s1(i16 signext %s) nounwind { +entry: + store i16 %s, i16* getelementptr (%struct.hackstate* @state, i32 0, i32 4), align 16 + ret void +} -define void @set_hackstate_i6(i32 %i) { +define void @set_hackstate_i3(i32 %i) nounwind { entry: - store i32 %i, i32* getelementptr (%struct.hackstate* @state, i32 0, i32 13), align 16 - ret void + store i32 %i, i32* getelementptr (%struct.hackstate* @state, i32 0, i32 10), align 16 + ret void } +define void @set_hackstate_i6(i32 %i) nounwind { +entry: + store i32 %i, i32* getelementptr (%struct.hackstate* @state, i32 0, i32 13), align 16 + ret void +} diff --git a/test/CodeGen/CellSPU/struct_2.ll b/test/CodeGen/CellSPU/struct_2.ll deleted file mode 100644 index fee9c01..0000000 --- a/test/CodeGen/CellSPU/struct_2.ll +++ /dev/null @@ -1,122 +0,0 @@ -; RUN: llvm-as -o - %s | llc -march=cellspu > %t1.s -; RUN: grep lqx %t1.s | count 14 -; RUN: grep rotqby %t1.s | count 7 -; RUN: grep xshw %t1.s | count 1 -; RUN: grep andi %t1.s | count 4 -; RUN: grep cbx %t1.s | count 1 -; RUN: grep cbd %t1.s | count 2 -; RUN: grep chd %t1.s | count 1 -; RUN: grep cwd %t1.s | count 3 -; RUN: grep shufb %t1.s | count 7 -; RUN: grep stqx %t1.s | count 7 - -; ModuleID = 'struct_1.bc' -target datalayout = "E-p:32:32:128-f64:64:128-f32:32:128-i64:32:128-i32:32:128-i16:16:128-i8:8:128-i1:8:128-a0:0:128-v128:128:128-s0:128:128" -target triple = "spu" - -; struct hackstate { -; unsigned char c1; // offset 0 (rotate left by 13 bytes to byte 3) -; unsigned char c2; // offset 1 (rotate left by 14 bytes to byte 3) -; unsigned char c3; // offset 2 (rotate left by 15 bytes to byte 3) -; int i1; // offset 4 (rotate left by 4 bytes to byte 0) -; short s1; // offset 8 (rotate left by 6 bytes to byte 2) -; int i2; // offset 12 [ignored] -; unsigned char c4; // offset 16 [ignored] -; unsigned char c5; // offset 17 [ignored] -; unsigned char c6; // offset 18 [ignored] -; unsigned char c7; // offset 19 (no rotate, in preferred slot) -; int i3; // offset 20 [ignored] -; int i4; // offset 24 [ignored] -; int i5; // offset 28 [ignored] -; int i6; // offset 32 (no rotate, in preferred slot) -; } -%struct.hackstate = type { i8, i8, i8, i32, i16, i32, i8, i8, i8, i8, i32, i32, i32, i32 } - -; struct hackstate state = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } -@state = global %struct.hackstate zeroinitializer, align 4 - -define i8 @get_hackstate_c1() zeroext { -entry: - %tmp2 = load i8* getelementptr (%struct.hackstate* @state, i32 0, i32 0), align 4 - ret i8 %tmp2 -} - -define i8 @get_hackstate_c2() zeroext { -entry: - %tmp2 = load i8* getelementptr (%struct.hackstate* @state, i32 0, i32 1), align 4 - ret i8 %tmp2 -} - -define i8 @get_hackstate_c3() zeroext { -entry: - %tmp2 = load i8* getelementptr (%struct.hackstate* @state, i32 0, i32 2), align 4 - ret i8 %tmp2 -} - -define i32 @get_hackstate_i1() { -entry: - %tmp2 = load i32* getelementptr (%struct.hackstate* @state, i32 0, i32 3), align 4 - ret i32 %tmp2 -} - -define i16 @get_hackstate_s1() signext { -entry: - %tmp2 = load i16* getelementptr (%struct.hackstate* @state, i32 0, i32 4), align 4 - ret i16 %tmp2 -} - -define i8 @get_hackstate_c7() zeroext { -entry: - %tmp2 = load i8* getelementptr (%struct.hackstate* @state, i32 0, i32 9), align 4 - ret i8 %tmp2 -} - -define i32 @get_hackstate_i6() zeroext { -entry: - %tmp2 = load i32* getelementptr (%struct.hackstate* @state, i32 0, i32 13), align 4 - ret i32 %tmp2 -} - -define void @set_hackstate_c1(i8 zeroext %c) { -entry: - store i8 %c, i8* getelementptr (%struct.hackstate* @state, i32 0, i32 0), align 4 - ret void -} - -define void @set_hackstate_c2(i8 zeroext %c) { -entry: - store i8 %c, i8* getelementptr (%struct.hackstate* @state, i32 0, i32 1), align 4 - ret void -} - -define void @set_hackstate_c3(i8 zeroext %c) { -entry: - store i8 %c, i8* getelementptr (%struct.hackstate* @state, i32 0, i32 2), align 4 - ret void -} - -define void @set_hackstate_i1(i32 %i) { -entry: - store i32 %i, i32* getelementptr (%struct.hackstate* @state, i32 0, i32 3), align 4 - ret void -} - -define void @set_hackstate_s1(i16 signext %s) { -entry: - store i16 %s, i16* getelementptr (%struct.hackstate* @state, i32 0, i32 4), align 4 - ret void -} - -define void @set_hackstate_i3(i32 %i) { -entry: - store i32 %i, i32* getelementptr (%struct.hackstate* @state, i32 0, i32 11), align 4 - ret void -} - - -define void @set_hackstate_i6(i32 %i) { -entry: - store i32 %i, i32* getelementptr (%struct.hackstate* @state, i32 0, i32 13), align 4 - ret void -} - diff --git a/test/CodeGen/CellSPU/vec_const.ll b/test/CodeGen/CellSPU/vec_const.ll index 46109e3..3f7eb62 100644 --- a/test/CodeGen/CellSPU/vec_const.ll +++ b/test/CodeGen/CellSPU/vec_const.ll @@ -1,11 +1,11 @@ ; RUN: llvm-as -o - %s | llc -march=cellspu > %t1.s ; RUN: llvm-as -o - %s | llc -march=cellspu -mattr=large_mem > %t2.s -; RUN: grep il %t1.s | count 16 -; RUN: grep ilhu %t1.s | count 8 +; RUN: grep il %t1.s | count 16 +; RUN: grep ilhu %t1.s | count 8 ; RUN: grep ilh %t1.s | count 13 ; RUN: grep iohl %t1.s | count 7 ; RUN: grep lqa %t1.s | count 6 -; RUN: grep 24672 %t1.s | count 2 +; RUN: grep 24672 %t1.s | count 2 ; RUN: grep 16429 %t1.s | count 1 ; RUN: grep 63572 %t1.s | count 1 ; RUN: grep 4660 %t1.s | count 1 @@ -17,8 +17,7 @@ ; RUN: grep 21572 %t1.s | count 1 ; RUN: grep 11544 %t1.s | count 1 ; RUN: grep 1311768467750121234 %t1.s | count 1 -; RUN: grep lqx %t2.s | count 6 -; RUN: grep ila %t2.s | count 6 +; RUN: grep lqd %t2.s | count 6 target datalayout = "E-p:32:32:128-f64:64:128-f32:32:128-i64:32:128-i32:32:128-i16:16:128-i8:8:128-i1:8:128-a0:0:128-v128:128:128" target triple = "spu-unknown-elf" |