[llvm-commits] [llvm] r58517 - /llvm/trunk/lib/Target/X86/X86RegisterInfo.td

Dan Gohman gohman at apple.com
Mon Nov 3 09:00:26 PST 2008


On Fri, October 31, 2008 8:52 am, Evan Cheng wrote:
> Author: evancheng
> Date: Fri Oct 31 11:52:57 2008
> New Revision: 58517
>
> URL: http://llvm.org/viewvc/llvm-project?rev=58517&view=rev
> Log:
> Change x86 register allocation ordering to match that of gcc. Otherwise
> some tools get confused by prologue generated by llvm.

What tools depend on the order that compilers allocate registers?

> def GR64 : RegisterClass<"X86", [i64], 64,
>                           [RAX, RCX, RDX, RSI, RDI, R8, R9, R10, R11,
> -                          RBX, R14, R15, R12, R13, RBP, RSP]> {
> +                          RBX, R12, R13, R14, R15, RBP, RSP]> {

Registers %r13 and %rbp are special and require some instructions to
be encoded differently. It's desirable to allocate them last.
For example, instructions like this:

  leaq (%r13,%rax),%rax

must be encoded with a displacement immediate field when the
base register is %r13 or %rbp, but it doesn't require one for
other registers.

Dan





More information about the llvm-commits mailing list