llvm-6502/test/CodeGen/PowerPC/vrspill.ll
Hal Finkel 3249729043 Improve PPC VR (Altivec) register spilling
This change cleans up two issues with Altivec register spilling:

  1. The spilling code was inefficient (using two instructions, and add and a
     load, when just one would do)

  2. The code assumed that r0 would always be available (true for now, but this
     will change)

The new code handles VR spilling just like GPR spills but forced into r+r mode.
As a result, when any VR spills are present, we must now always allocate the
register-scavenger spill slot.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@177231 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-17 04:43:44 +00:00

20 lines
637 B
LLVM

; RUN: llc -O0 -mtriple=powerpc-unknown-linux-gnu -mattr=+altivec -verify-machineinstrs < %s | FileCheck %s
; RUN: llc -O0 -mtriple=powerpc64-unknown-linux-gnu -mattr=+altivec -verify-machineinstrs < %s | FileCheck %s
; This verifies that we generate correct spill/reload code for vector regs.
define void @addrtaken(i32 %i, <4 x float> %w) nounwind {
entry:
%i.addr = alloca i32, align 4
%w.addr = alloca <4 x float>, align 16
store i32 %i, i32* %i.addr, align 4
store <4 x float> %w, <4 x float>* %w.addr, align 16
call void @foo(i32* %i.addr)
ret void
}
; CHECK: stvx 2, 1,
; CHECK: lvx 2, 1,
declare void @foo(i32*)