diff options
| author | Matthias Braun <matze@braunis.de> | 2016-08-18 19:47:59 +0000 |
|---|---|---|
| committer | Matthias Braun <matze@braunis.de> | 2016-08-18 19:47:59 +0000 |
| commit | 075d0c23d5885d926a3497bd3504df1d81f04270 (patch) | |
| tree | 04a1d26fe9e2675ee3ea0f58e51e823ab8ba7cf4 /llvm/test | |
| parent | 85d0f3140a0714818093089da991776f115dfa0e (diff) | |
| download | bcm5719-llvm-075d0c23d5885d926a3497bd3504df1d81f04270.tar.gz bcm5719-llvm-075d0c23d5885d926a3497bd3504df1d81f04270.zip | |
RegScavenging: Add scavengeRegisterBackwards()
Re-apply r276044 with off-by-1 instruction fix for the reload placement.
This is a variant of scavengeRegister() that works for
enterBasicBlockEnd()/backward(). The benefit of the backward mode is
that it is not affected by incomplete kill flags.
This patch also changes
PrologEpilogInserter::doScavengeFrameVirtualRegs() to use the register
scavenger in backwards mode.
Differential Revision: http://reviews.llvm.org/D21885
llvm-svn: 279124
Diffstat (limited to 'llvm/test')
| -rw-r--r-- | llvm/test/CodeGen/AMDGPU/captured-frame-index.ll | 4 | ||||
| -rw-r--r-- | llvm/test/CodeGen/Mips/emergency-spill-slot-near-fp.ll | 88 | ||||
| -rw-r--r-- | llvm/test/CodeGen/PowerPC/dyn-alloca-aligned.ll | 4 | ||||
| -rw-r--r-- | llvm/test/CodeGen/Thumb/large-stack.ll | 4 |
4 files changed, 64 insertions, 36 deletions
diff --git a/llvm/test/CodeGen/AMDGPU/captured-frame-index.ll b/llvm/test/CodeGen/AMDGPU/captured-frame-index.ll index 161c46b486e..bf6e48d89ca 100644 --- a/llvm/test/CodeGen/AMDGPU/captured-frame-index.ll +++ b/llvm/test/CodeGen/AMDGPU/captured-frame-index.ll @@ -140,8 +140,8 @@ define void @stored_fi_to_global_2_small_objects(float* addrspace(1)* %ptr) #0 { } ; GCN-LABEL: {{^}}stored_fi_to_global_huge_frame_offset: -; GCN: s_add_i32 [[BASE_1_OFF_0:s[0-9]+]], 0, 0x3ffc -; GCN: v_mov_b32_e32 [[BASE_0:v[0-9]+]], 0{{$}} +; GCN-DAG: s_add_i32 [[BASE_1_OFF_0:s[0-9]+]], 0, 0x3ffc +; GCN-DAG: v_mov_b32_e32 [[BASE_0:v[0-9]+]], 0{{$}} ; GCN: buffer_store_dword [[BASE_0]], v{{[0-9]+}}, s{{\[[0-9]+:[0-9]+\]}}, s{{[0-9]+}} offen ; GCN: v_mov_b32_e32 [[V_BASE_1_OFF_0:v[0-9]+]], [[BASE_1_OFF_0]] diff --git a/llvm/test/CodeGen/Mips/emergency-spill-slot-near-fp.ll b/llvm/test/CodeGen/Mips/emergency-spill-slot-near-fp.ll index a08b68149a7..625abc1a7e0 100644 --- a/llvm/test/CodeGen/Mips/emergency-spill-slot-near-fp.ll +++ b/llvm/test/CodeGen/Mips/emergency-spill-slot-near-fp.ll @@ -1,34 +1,62 @@ -; Check that register scavenging spill slot is close to $fp. ; RUN: llc -march=mipsel -O0 -relocation-model=pic < %s | FileCheck %s +; Check that register scavenging spill slot is close to $fp. +target triple="mipsel--" -; CHECK: sw ${{.*}}, 8($sp) -; CHECK: lw ${{.*}}, 8($sp) +@var = external global i32 +@ptrvar = external global i8* -define i32 @main(i32 signext %argc, i8** %argv) #0 { -entry: - %retval = alloca i32, align 4 - %argc.addr = alloca i32, align 4 - %argv.addr = alloca i8**, align 4 - %v0 = alloca <16 x i8>, align 16 - %.compoundliteral = alloca <16 x i8>, align 16 - %v1 = alloca <16 x i8>, align 16 - %.compoundliteral1 = alloca <16 x i8>, align 16 - %unused_variable = alloca [16384 x i32], align 4 - %result = alloca <16 x i8>, align 16 - store i32 0, i32* %retval - store i32 %argc, i32* %argc.addr, align 4 - store i8** %argv, i8*** %argv.addr, align 4 - store <16 x i8> <i8 1, i8 2, i8 3, i8 4, i8 5, i8 6, i8 7, i8 8, i8 9, i8 10, i8 11, i8 12, i8 13, i8 14, i8 15, i8 16>, <16 x i8>* %.compoundliteral - %0 = load <16 x i8>, <16 x i8>* %.compoundliteral - store <16 x i8> %0, <16 x i8>* %v0, align 16 - store <16 x i8> zeroinitializer, <16 x i8>* %.compoundliteral1 - %1 = load <16 x i8>, <16 x i8>* %.compoundliteral1 - store <16 x i8> %1, <16 x i8>* %v1, align 16 - %2 = load <16 x i8>, <16 x i8>* %v0, align 16 - %3 = load <16 x i8>, <16 x i8>* %v1, align 16 - %mul = mul <16 x i8> %2, %3 - store <16 x i8> %mul, <16 x i8>* %result, align 16 - ret i32 0 -} +; CHECK-LABEL: func: +define void @func() { + %space = alloca i32, align 4 + %stackspace = alloca[16384 x i32], align 4 + + ; ensure stackspace is not optimized out + %stackspace_casted = bitcast [16384 x i32]* %stackspace to i8* + store volatile i8* %stackspace_casted, i8** @ptrvar -attributes #0 = { noinline "no-frame-pointer-elim"="true" } + ; Load values to increase register pressure. + %v0 = load volatile i32, i32* @var + %v1 = load volatile i32, i32* @var + %v2 = load volatile i32, i32* @var + %v3 = load volatile i32, i32* @var + %v4 = load volatile i32, i32* @var + %v5 = load volatile i32, i32* @var + %v6 = load volatile i32, i32* @var + %v7 = load volatile i32, i32* @var + %v8 = load volatile i32, i32* @var + %v9 = load volatile i32, i32* @var + %v10 = load volatile i32, i32* @var + %v11 = load volatile i32, i32* @var + %v12 = load volatile i32, i32* @var + %v13 = load volatile i32, i32* @var + %v14 = load volatile i32, i32* @var + %v15 = load volatile i32, i32* @var + %v16 = load volatile i32, i32* @var + + ; Computing a stack-relative values needs an additional register. + ; We should get an emergency spill/reload for this. + ; CHECK: sw ${{.*}}, 0($sp) + ; CHECK: lw ${{.*}}, 0($sp) + store volatile i32 %v0, i32* %space + + ; store values so they are used. + store volatile i32 %v0, i32* @var + store volatile i32 %v1, i32* @var + store volatile i32 %v2, i32* @var + store volatile i32 %v3, i32* @var + store volatile i32 %v4, i32* @var + store volatile i32 %v5, i32* @var + store volatile i32 %v6, i32* @var + store volatile i32 %v7, i32* @var + store volatile i32 %v8, i32* @var + store volatile i32 %v9, i32* @var + store volatile i32 %v10, i32* @var + store volatile i32 %v11, i32* @var + store volatile i32 %v12, i32* @var + store volatile i32 %v13, i32* @var + store volatile i32 %v14, i32* @var + store volatile i32 %v15, i32* @var + store volatile i32 %v16, i32* @var + + ret void +} diff --git a/llvm/test/CodeGen/PowerPC/dyn-alloca-aligned.ll b/llvm/test/CodeGen/PowerPC/dyn-alloca-aligned.ll index 0de2e220c2c..e0f28475d8f 100644 --- a/llvm/test/CodeGen/PowerPC/dyn-alloca-aligned.ll +++ b/llvm/test/CodeGen/PowerPC/dyn-alloca-aligned.ll @@ -25,8 +25,8 @@ entry: ; CHECK-DAG: li [[REG1:[0-9]+]], -128 ; CHECK-DAG: neg [[REG2:[0-9]+]], -; CHECK: and [[REG1]], [[REG2]], [[REG1]] -; CHECK: stdux {{[0-9]+}}, 1, [[REG1]] +; CHECK: and [[REG3:[0-9]+]], [[REG2]], [[REG1]] +; CHECK: stdux {{[0-9]+}}, 1, [[REG3]] ; CHECK: blr diff --git a/llvm/test/CodeGen/Thumb/large-stack.ll b/llvm/test/CodeGen/Thumb/large-stack.ll index c5d1044e9d6..c72a67cd8ea 100644 --- a/llvm/test/CodeGen/Thumb/large-stack.ll +++ b/llvm/test/CodeGen/Thumb/large-stack.ll @@ -46,8 +46,8 @@ define i32 @test3() { ; CHECK-LABEL: test3: ; CHECK: ldr [[TEMP:r[0-7]]], ; CHECK: add sp, [[TEMP]] -; CHECK: ldr [[TEMP]], -; CHECK: add [[TEMP]], sp +; CHECK: ldr [[TEMP2:r[0-7]]], +; CHECK: add [[TEMP2]], sp ; EABI: ldr [[TEMP:r[0-7]]], ; EABI: add sp, [[TEMP]] ; IOS: subs r4, r7, #4 |

