[llvm-commits] [llvm] r112742 - /llvm/trunk/lib/CodeGen/RegAllocPBQP.cpp

Evan Cheng evan.cheng at apple.com
Thu Sep 9 23:53:03 PDT 2010


Hmm. I really am not seeing the advantage of doing the check in every register allocator (as opposed to have allocation_order_* excluding non-allocatable registers). Now all the out-of-tree register allocators will need have the same code. I missed a lot of patches during the last few weeks. What's the motivation for this change?

Evan

On Sep 1, 2010, at 2:23 PM, Jim Grosbach wrote:

> Author: grosbach
> Date: Wed Sep  1 16:23:03 2010
> New Revision: 112742
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=112742&view=rev
> Log:
> The register allocator shouldn't consider allocating reserved registers. PBQP version.
> 
> Modified:
>    llvm/trunk/lib/CodeGen/RegAllocPBQP.cpp
> 
> Modified: llvm/trunk/lib/CodeGen/RegAllocPBQP.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegAllocPBQP.cpp?rev=112742&r1=112741&r2=112742&view=diff
> ==============================================================================
> --- llvm/trunk/lib/CodeGen/RegAllocPBQP.cpp (original)
> +++ llvm/trunk/lib/CodeGen/RegAllocPBQP.cpp Wed Sep  1 16:23:03 2010
> @@ -587,6 +587,8 @@
>   // Resize allowedSets container appropriately.
>   allowedSets.resize(vregIntervalsToAlloc.size());
> 
> +  BitVector ReservedRegs = tri->getReservedRegs(*mf);
> +
>   // Iterate over virtual register intervals to compute allowed sets...
>   for (unsigned node = 0; node < node2LI.size(); ++node) {
> 
> @@ -595,8 +597,12 @@
>     const TargetRegisterClass *liRC = mri->getRegClass(li->reg);
> 
>     // Start by assuming all allocable registers in the class are allowed...
> -    RegVector liAllowed(liRC->allocation_order_begin(*mf),
> -                        liRC->allocation_order_end(*mf));
> +    RegVector liAllowed;
> +    TargetRegisterClass::iterator aob = liRC->allocation_order_begin(*mf);
> +    TargetRegisterClass::iterator aoe = liRC->allocation_order_end(*mf);
> +    for (TargetRegisterClass::iterator it = aob; it != aoe; ++it)
> +      if (!ReservedRegs.test(*it))
> +        liAllowed.push_back(*it);
> 
>     // Eliminate the physical registers which overlap with this range, along
>     // with all their aliases.
> 
> 
> _______________________________________________
> 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