[LLVMdev] Eliminating copies between overlapping register classes

Tom Stellard thomas.stellard at amd.com
Wed Feb 22 12:01:44 PST 2012


I have two register classes A and B, where A contains a subset of the
registers in B:

A = [R0, R1, R2, ... R128]

B = [RO, R1, R2, ... R128,
     T0, T1, T2, ... T128]

I am using the Greedy Register Allocator, and I would expect the register
allocator to eliminate this copy:

%vreg0<def> = COPY %vreg1; B:%vreg0 A:%vreg1

but instead I end up with

%R0<def> = COPY %R1

Is there any way I can get the register allocator to eliminate these
kinds of copies?


More information about the llvm-dev mailing list