[X86] Use 4 byte preferred aggregate alignment on Win32
authorReid Kleckner <reid@kleckner.net>
Thu, 30 Apr 2015 22:11:59 +0000 (22:11 +0000)
committerReid Kleckner <reid@kleckner.net>
Thu, 30 Apr 2015 22:11:59 +0000 (22:11 +0000)
commit7a1b190bcd92cc0b0a1e089f981372cf236afe15
treebde3f6927bf91a74992220bbd244d9fe4f20ae8f
parentaf2e236c11505b453ea7ffff2011e07d955a4e5d
[X86] Use 4 byte preferred aggregate alignment on Win32

This helps reduce the frequency of stack realignment prologues in 32-bit
X86 Windows code. Before this change and the corresponding clang change,
we would take the max of the type preferred alignment and the explicit
alignment on the alloca.

If you don't override aggregate alignment in datalayout, you get a
default of 8. This dates back to 2007 / r34356, and changing it seems
prohibitively difficult at this point.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236270 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86TargetMachine.cpp
test/CodeGen/X86/inalloca-invoke.ll
test/CodeGen/X86/inalloca-stdcall.ll
test/CodeGen/X86/inalloca.ll
test/CodeGen/X86/win32_sret.ll