[llvm-commits] [PATCH] Don't allocate out-of-class reserved register in regscavenger

Evan Cheng evan.cheng at apple.com
Wed Jul 15 11:33:07 PDT 2009


Looks good. Please commit. Thanks.

Evan

On Jul 14, 2009, at 12:37 PM, Jakob Stoklund Olesen wrote:

> Hi,
>
> The attached patch fixes a bug in RegScavenger::scavengeRegister():
>
> Reserved registers are not candidates for scavenging, and they are  
> removed from the candidate list (a BitVector) like this:
>
>    CreateRegClassMask(RC, Candidates);
>    Candidates ^= ReservedRegs;
>
> However, when there are reserved registers outside RC, this causes  
> invalid bits to be set in Candidates.
>
> <scavenger-fix.patch>
>
>
> A better solution would perhaps be to add the method BitVector::reset 
> (const BitVector&):
>
>    Candidates.reset(ReservedRegs);
>
> What do you think?
>
> /jakob
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits




More information about the llvm-commits mailing list