1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 19:23:23 +01:00

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:
Jakob Stoklund Olesen 2012-05-29 23:40:02 +00:00
parent 16603c4371
commit c83fa0a0e4

View File

@ -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;
}