[PBQP] Conservativelly allocatable nodes can be spilled and give a better solution
authorArnaud A. de Grandmaison <arnaud.degrandmaison@arm.com>
Fri, 13 Feb 2015 12:04:42 +0000 (12:04 +0000)
committerArnaud A. de Grandmaison <arnaud.degrandmaison@arm.com>
Fri, 13 Feb 2015 12:04:42 +0000 (12:04 +0000)
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229103 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/CodeGen/RegAllocPBQP.h
lib/CodeGen/RegAllocPBQP.cpp

index 80d232a215a0004efa236140ffdf1842bfecc6c9..6d709d2b5e0d43102eefa60e4728d34a0bcebcce 100644 (file)
@@ -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();
index 0fb4ef62eff936e6a39767bd6764ad55f31d3846..bdc669ce4eff14d040c722417f0c145194f8be04 100644 (file)
@@ -621,8 +621,6 @@ bool RegAllocPBQP::mapPBQPToRegAlloc(const PBQPRAGraph &G,
       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;