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:
parent
16603c4371
commit
c83fa0a0e4
@ -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
Block a user