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

Jakob Stoklund Olesen stoklund at 2pi.dk
Tue Jul 14 12:37:23 PDT 2009


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.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: scavenger-fix.patch
Type: application/octet-stream
Size: 1300 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20090714/fd2bb252/attachment.obj>
-------------- next part --------------



A better solution would perhaps be to add the method  
BitVector::reset(const BitVector&):

     Candidates.reset(ReservedRegs);

What do you think?

/jakob



More information about the llvm-commits mailing list