forked from OSchip/llvm-project
Use MCRegUnitIterator to compute regsOverlap().
The register unit lists are typically much shorter than the register overlap lists, and the backing table for register units has better cache locality because it is smaller. This makes llc about 0.5% faster. The regsOverlap() function isn't that hot. llvm-svn: 157651
This commit is contained in:
parent
7f381bd26d
commit
850ef99516
|
@ -337,9 +337,15 @@ public:
|
|||
if (regA == regB) return true;
|
||||
if (isVirtualRegister(regA) || isVirtualRegister(regB))
|
||||
return false;
|
||||
for (const uint16_t *regList = getOverlaps(regA)+1; *regList; ++regList) {
|
||||
if (*regList == regB) return true;
|
||||
}
|
||||
|
||||
// Regunits are numerically ordered. Find a common unit.
|
||||
MCRegUnitIterator RUA(regA, this);
|
||||
MCRegUnitIterator RUB(regB, this);
|
||||
do {
|
||||
if (*RUA == *RUB) return true;
|
||||
if (*RUA < *RUB) ++RUA;
|
||||
else ++RUB;
|
||||
} while (RUA.isValid() && RUB.isValid());
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue