Opened 7 years ago

Last modified 4 years ago

#7063 new bug

Register allocators can't handle non-uniform register sets

Reported by: simonmar Owned by: benl
Priority: normal Milestone:
Component: Compiler (NCG) Version: 7.4.2
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: x86
Type of failure: Runtime performance bug Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


Neither the linear scan register allocator nor the graph-colouring allocator can properly handle the fact that some registers on x86 have 8 and 16-bit versions and some don't. We got away with this until now because the only free registers on x86 were %eax, %ecx and %edx, but now we can also treat %esi as free when it isn't being used for R1 (see f857f0741515b9ebf186beb38fe64448de355817). However, %esi doesn't have an 8-bit version, so we cannot treat it as allocatable because the register allocator will try to use it when an 8-bit register is needed (see 105754792adac0802a9a59b0df188b58fb53503f).

LLVM doesn't have this problem, so one workaround is to compile with -fllvm to get the extra register(s) on x86.

Change History (5)

comment:1 Changed 7 years ago by benl

Owner: set to benl

comment:2 Changed 5 years ago by thoughtpolice


Moving to 7.10.1.

comment:3 Changed 5 years ago by thoughtpolice


Moving to 7.12.1 milestone; if you feel this is an error and should be addressed sooner, please move it back to the 7.10.1 milestone.

comment:4 Changed 4 years ago by thoughtpolice


Milestone renamed

comment:5 Changed 4 years ago by thomie

Milestone: 8.0.1
Note: See TracTickets for help on using tickets.