Skip to content

Lousy spilling in the RegAlloc's #124350

Open
@Bob64375

Description

@Bob64375

Hi,

I'm populating llvm through IRBuilder with some 400+ Alloca's, most of them 8 byte double types.

The total stack size pumped via. the Alloca's is 3520 bytes.

The stack size after RegAllocBasic, or RegAllocGreedy, or RegAllocPBQP varies between 7320 - 7480 bytes.

That's more than double the stack size needed, the extra of which appear to be originating from spills.

The bottom line is there's likely as much code managing irrelevant spills as there is real code, and further, the spills introduce a 2nd unnecessary 4k page.

This ugliness only became apparent when I introduced in the pipeline prior to populating llvm a modified Lal George and Andrew Appel, "Iterated Register Coalescing" algorithm. The output of this algorithm coalesces stack symbols such that the 3520 bytes from the Alloca's is about as close to minimal as can be obtained. Thus, llvm's RegAlloc's compress the stack no further. Prior to doing this the size pumped through Alloca's was 156728 bytes, and the llvm stack size of 7480 bytes seemed impressive. Right. Not happy.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions