[LLVMbugs] [Bug 10075] New: Fast register allocator produces code that uses a lot of stack

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Jun 3 14:55:51 PDT 2011


http://llvm.org/bugs/show_bug.cgi?id=10075

           Summary: Fast register allocator produces code that uses a lot
                    of stack
           Product: libraries
           Version: trunk
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Register Allocator
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: rafael.espindola at gmail.com
                CC: llvmbugs at cs.uiuc.edu


Created an attachment (id=6689)
 --> (http://llvm.org/bugs/attachment.cgi?id=6689)
bitcode testcase

I know that the main objective of the fast register allocator is speed, but I
am getting test failures -O0 because the tests run out of stack space :-(

The results I got for the largest function by recompiling the .ii with gcc and
clang:

clang O0 0x00004690
gcc   O0 0x00001560

clang O1 0x00000868
gcc   O1 0x00000b98

clang O2 0x00000aa8
gcc   O2 0x00000bd8

clang O3 0x00000ab8
gcc   O3 0x00000bd8

clang Os 0x000010b8
gcc   Os 0x00000698

I then found that most of the -O0 to -O1 difference was because of the register
allocator:

$ llc jsinterp.bc  -o jsinterp.o -filetype=obj -regalloc=greedy -O0
$ otool -t -v jsinterp.o | grep -A 8
__ZN2js9InterpretEP9JSContextPNS_10StackFrameEjNS_10InterpModeE | grep sub.*rsp

000000000000001a    subq    $0x00001c78,%rsp

$ llc jsinterp.bc  -o jsinterp.o -filetype=obj -regalloc=fast -O0
$ otool -t -v jsinterp.o | grep -A 8
__ZN2js9InterpretEP9JSContextPNS_10StackFrameEjNS_10InterpModeE | grep sub.*rsp

0000000000000010    subq    $0x000045d8,%rsp

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list