@@ -362,6 +362,7 @@ namespace vISA
362362 LiveRange**& lrs;
363363 IR_Builder& builder;
364364 unsigned maxId;
365+ unsigned rowSize;
365366 unsigned splitStartId;
366367 unsigned splitNum;
367368 unsigned int * matrix = nullptr ;
@@ -413,7 +414,7 @@ namespace vISA
413414 {
414415 if (useDenseMatrix ())
415416 {
416- unsigned N = getRowSize () * maxId;
417+ unsigned N = rowSize * maxId;
417418 matrix = new uint32_t [N];
418419 memset (matrix, 0 , N * sizeof (int ));
419420 }
@@ -434,7 +435,7 @@ namespace vISA
434435 sparseIntf.clear ();
435436 if (useDenseMatrix ())
436437 {
437- unsigned N = getRowSize () * maxId;
438+ unsigned N = rowSize * maxId;
438439 std::memset (matrix, 0 , N * sizeof (int ));
439440 }
440441 else
@@ -453,10 +454,6 @@ namespace vISA
453454 assert (useDenseMatrix () && " matrix is not initialized" );
454455 return matrix != nullptr ? matrix[idx] : 0 ;
455456 }
456- inline unsigned int getRowSize () const
457- {
458- return maxId / BITS_DWORD + 1 ;
459- }
460457
461458 std::vector<unsigned int >& getSparseIntfForVar (unsigned int id) { return sparseIntf[id]; }
462459
@@ -467,7 +464,7 @@ namespace vISA
467464 if (useDenseMatrix ())
468465 {
469466 unsigned col = v2 / BITS_DWORD;
470- matrix[v1 * getRowSize () + col] |= BitMask[v2 - col * BITS_DWORD];
467+ matrix[v1 * rowSize + col] |= BitMask[v2 - col * BITS_DWORD];
471468 }
472469 else
473470 {
@@ -483,7 +480,7 @@ namespace vISA
483480 MUST_BE_TRUE (sparseIntf.size () == 0 , " Updating intf graph matrix after populating sparse intf graph" );
484481#endif
485482
486- matrix[v1 * getRowSize () + col] |= block;
483+ matrix[v1 * rowSize + col] |= block;
487484 }
488485 else
489486 {
0 commit comments