[llvm] r229103 - [PBQP] Conservativelly allocatable nodes can be spilled and give a better solution

Arnaud A. de Grandmaison arnaud.degrandmaison at arm.com
Fri Feb 13 04:04:42 PST 2015


Author: aadg
Date: Fri Feb 13 06:04:42 2015
New Revision: 229103

URL: http://llvm.org/viewvc/llvm-project?rev=229103&view=rev
Log:
[PBQP] Conservativelly allocatable nodes can be spilled and give a better solution

Although such nodes are allocatable, the cost of spilling may be less than
allocating to register, so spilling the node may provide a better solution.
The assert does not account for this case, so remove it for now.

Modified:
    llvm/trunk/include/llvm/CodeGen/RegAllocPBQP.h
    llvm/trunk/lib/CodeGen/RegAllocPBQP.cpp

Modified: llvm/trunk/include/llvm/CodeGen/RegAllocPBQP.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/RegAllocPBQP.h?rev=229103&r1=229102&r2=229103&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/RegAllocPBQP.h (original)
+++ llvm/trunk/include/llvm/CodeGen/RegAllocPBQP.h Fri Feb 13 06:04:42 2015
@@ -257,9 +257,6 @@ public:
     assert(RS >= this->RS && "A node's reduction state can not be downgraded");
     this->RS = RS;
   }
-  bool isSpillable() const {
-    return RS == NotProvablyAllocatable || RS == OptimallyReducible;
-  }
 
   void handleAddEdge(const MatrixMetadata& MD, bool Transpose) {
     DeniedOpts += Transpose ? MD.getWorstRow() : MD.getWorstCol();

Modified: llvm/trunk/lib/CodeGen/RegAllocPBQP.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegAllocPBQP.cpp?rev=229103&r1=229102&r2=229103&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/RegAllocPBQP.cpp (original)
+++ llvm/trunk/lib/CodeGen/RegAllocPBQP.cpp Fri Feb 13 06:04:42 2015
@@ -621,8 +621,6 @@ bool RegAllocPBQP::mapPBQPToRegAlloc(con
       assert(PReg != 0 && "Invalid preg selected.");
       VRM.assignVirt2Phys(VReg, PReg);
     } else {
-      assert(G.getNodeMetadata(NId).isSpillable() &&
-             "Spilling a node which can not be spilled.");
       // Spill VReg. If this introduces new intervals we'll need another round
       // of allocation.
       SmallVector<unsigned, 8> NewVRegs;





More information about the llvm-commits mailing list