Infer alignment of loads and increase their alignment when we can tell they are
authorChris Lattner <sabre@nondot.org>
Sat, 26 Jan 2008 19:45:50 +0000 (19:45 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 26 Jan 2008 19:45:50 +0000 (19:45 +0000)
commit1329cb8d8992c34365fcc2ac0447356708157dfb
tree70766a5116a8fd3fc49296152fc8260d06625cbe
parent216f3f6522ca2d056d644bb24e4d73a1f2335f6d
Infer alignment of loads and increase their alignment when we can tell they are
from the stack.  This allows us to compile stack-align.ll to:

_test:
movsd LCPI1_0, %xmm0
movapd %xmm0, %xmm1
*** andpd 4(%esp), %xmm1
andpd _G, %xmm0
addsd %xmm1, %xmm0
movl 20(%esp), %eax
movsd %xmm0, (%eax)
ret

instead of:

_test:
movsd LCPI1_0, %xmm0
** movsd 4(%esp), %xmm1
** andpd %xmm0, %xmm1
andpd _G, %xmm0
addsd %xmm1, %xmm0
movl 20(%esp), %eax
movsd %xmm0, (%eax)
ret

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46401 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/SelectionDAG/DAGCombiner.cpp
test/CodeGen/X86/stack-align.ll [new file with mode: 0644]