[ASan] Don't use stack malloc for 32-bit functions using inline asm
authorReid Kleckner <reid@kleckner.net>
Thu, 2 Apr 2015 21:44:55 +0000 (21:44 +0000)
committerReid Kleckner <reid@kleckner.net>
Thu, 2 Apr 2015 21:44:55 +0000 (21:44 +0000)
commit0f8f086e21ed1852884dfc281248fcba72059f49
tree3e8f39205782e3f41f2cca7c07d16562fd17f2a7
parent7c2e691607c6137fb8e29d46f85a9599c5b0c45b
[ASan] Don't use stack malloc for 32-bit functions using inline asm

This prevents us from running out of registers in the backend.

Introducing stack malloc calls prevents the backend from recognizing the
inline asm operands as stack objects. When the backend recognizes a
stack object, it doesn't need to materialize the address of the memory
in a physical register. Instead it generates a simple SP-based memory
operand. Introducing a stack malloc forces the backend to find a free
register for every memory operand. 32-bit x86 simply doesn't have enough
registers for this to succeed in most cases.

Reviewers: kcc, samsonov

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233979 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Instrumentation/AddressSanitizer.cpp
test/Instrumentation/AddressSanitizer/X86/asm_cpuid.ll [new file with mode: 0644]