This is an archive of the discontinued LLVM Phabricator instance.

[ASan] Don't use stack malloc for 32-bit functions using inline asm
ClosedPublic

Authored by rnk on Apr 1 2015, 4:10 PM.

Details

Summary

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.

Diff Detail

Repository
rL LLVM

Event Timeline

rnk updated this revision to Diff 23098.Apr 1 2015, 4:10 PM
rnk retitled this revision from to [ASan] Don't use stack malloc for 32-bit functions using inline asm.
rnk updated this object.
rnk added reviewers: kcc, samsonov.
rnk added a subscriber: Unknown Object (MLST).
samsonov accepted this revision.Apr 2 2015, 2:33 PM
samsonov edited edge metadata.

LGTM

This revision is now accepted and ready to land.Apr 2 2015, 2:33 PM
This revision was automatically updated to reflect the committed changes.