[LLVMdev] "Ran out of registers during register allocation" bug affecting ffmpeg

Cameron Esfahani dirty at apple.com
Tue Aug 31 01:01:03 PDT 2010


I've noticed this as well, when trying to compare output between MSVC and clang.  MSVC seems to do a pretty good job of not wasting any registers.  A side benefit is that MSVC seems to spill less registers to the stack...

On Aug 30, 2010, at 7:38 PM, Eli Friedman wrote:

> I measure a 1.7% increase in code-size compiling gcc with
> -disable-physical-join vs. normal compilation on x86-64.  That's
> pretty substantial.  Looking over the generated code, it looks like
> we're missing a lot of cases which seem like they should be easy, like
> not putting an immediately returned PHI node into eax, or calculating
> a value and immediately moving it into another register for a call.
> The difference isn't so bad on x86-32, only 0.25%.  I think that means
> the primary issue with using -disable-physical-join is that we're
> doing a really bad job of putting the arguments to calls in the right
> register.
> 
> Is the issue that the correct hints aren't there, or that the
> allocation algorithm isn't using them well?
> 
>> A quick fix would be to disable physreg coalescing for functions containing inline asm.
> 
> On x86-32, that probably wouldn't be such a big deal, but the effect
> looks really bad for x86-64, and probably other architectures that
> pass arguments in registers.

Cameron Esfahani
dirty at apple.com

"Even paranoids have enemies."

Henry Kissinger







More information about the llvm-dev mailing list