[PBQP] Fix transposed worst row/column check in handleAdd/RemoveNode in the PBQP
authorLang Hames <lhames@gmail.com>
Fri, 30 Jan 2015 22:28:49 +0000 (22:28 +0000)
committerLang Hames <lhames@gmail.com>
Fri, 30 Jan 2015 22:28:49 +0000 (22:28 +0000)
allocator.

Patch by Jonas Paulsson. Thanks Jonas!

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

include/llvm/CodeGen/RegAllocPBQP.h

index eceb790c547d027e59735903c7c367c051de0601..5c0e9859915f9a740a904e302b79392a86d44df6 100644 (file)
@@ -248,7 +248,7 @@ public:
   void setReductionState(ReductionState RS) { this->RS = RS; }
 
   void handleAddEdge(const MatrixMetadata& MD, bool Transpose) {
-    DeniedOpts += Transpose ? MD.getWorstCol() : MD.getWorstRow();
+    DeniedOpts += Transpose ? MD.getWorstRow() : MD.getWorstCol();
     const bool* UnsafeOpts =
       Transpose ? MD.getUnsafeCols() : MD.getUnsafeRows();
     for (unsigned i = 0; i < NumOpts; ++i)
@@ -256,7 +256,7 @@ public:
   }
 
   void handleRemoveEdge(const MatrixMetadata& MD, bool Transpose) {
-    DeniedOpts -= Transpose ? MD.getWorstCol() : MD.getWorstRow();
+    DeniedOpts -= Transpose ? MD.getWorstRow() : MD.getWorstCol();
     const bool* UnsafeOpts =
       Transpose ? MD.getUnsafeCols() : MD.getUnsafeRows();
     for (unsigned i = 0; i < NumOpts; ++i)