1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 19:12:56 +02:00
llvm-mirror/test/CodeGen
Jeroen Ketema 808a3386e2 Arguments spilled on the stack before a function call may have
alignment requirements, for example in the case of vectors.
These requirements are exploited by the code generator by using
move instructions that have similar alignment requirements, e.g.,
movaps on x86.

Although the code generator properly aligns the arguments with
respect to the displacement of the stack pointer it computes,
the displacement itself may cause misalignment. For example if
we have

%3 = load <16 x float>, <16 x float>* %1, align 64
call void @bar(<16 x float> %3, i32 0)

the x86 back-end emits:

movaps  32(%ecx), %xmm2
movaps  (%ecx), %xmm0
movaps  16(%ecx), %xmm1
movaps  48(%ecx), %xmm3
subl    $20, %esp       <-- if %esp was 16-byte aligned before this instruction, it no longer will be afterwards 
movaps  %xmm3, (%esp)   <-- movaps requires 16-byte alignment, while %esp is not aligned as such.
movl    $0, 16(%esp)
calll   __bar

To solve this, we need to make sure that the computed value with which
the stack pointer is changed is a multiple af the maximal alignment seen
during its computation. With this change we get proper alignment:

subl    $32, %esp
movaps  %xmm3, (%esp)

Differential Revision: http://reviews.llvm.org/D12337

llvm-svn: 248786
2015-09-29 10:12:57 +00:00
..
AArch64 Use fixed-point representation for BranchProbability. 2015-09-25 23:09:59 +00:00
AMDGPU AMDGPU: Fix splitting x16 SMRD loads 2015-09-28 20:54:52 +00:00
ARM [ARM] Don't generate clrex for pre-v7 targets. 2015-09-26 00:14:02 +00:00
BPF
CPP Fix CPP Backend for GEP API changes for opaque pointer types 2015-09-08 18:42:29 +00:00
Generic Make the default triple optional by allowing an empty string 2015-09-16 05:34:32 +00:00
Hexagon Update edge weights properly when merging blocks in if-conversion. 2015-09-18 20:22:41 +00:00
Inputs
Mips [opaque pointer type] Add textual IR support for explicit type parameter for global aliases 2015-09-11 03:22:04 +00:00
MIR Fix PR 24724 - The implicit register verifier shouldn't assume certain operand 2015-09-10 14:04:34 +00:00
MSP430
NVPTX
PowerPC [DAGCombine] Fix getStoreMergeAndAliasCandidates's AA-enabled chain walking 2015-09-28 08:02:14 +00:00
SPARC [SPARC] Switch to the Machine Scheduler. 2015-09-10 21:49:06 +00:00
SystemZ [SystemZ] Fix expansion of ISD::FPOW and ISD::FSINCOS 2015-09-21 17:35:45 +00:00
Thumb
Thumb2 Scaling up values in ARMBaseInstrInfo::isProfitableToIfCvt() before they are scaled by a probability to avoid precision issue. 2015-09-18 18:19:40 +00:00
WebAssembly [WebAssembly] Rename test files to match platform naming conventions. 2015-09-29 08:13:58 +00:00
WinEH [EH] Create removeUnwindEdge utility 2015-09-27 01:47:46 +00:00
X86 Arguments spilled on the stack before a function call may have 2015-09-29 10:12:57 +00:00
XCore [opaque pointer type] Add textual IR support for explicit type parameter for global aliases 2015-09-11 03:22:04 +00:00