mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-21 18:24:23 +00:00
Don't perform expensive queries checking for super and sub registers when we know that there aren't any.
This speed up LiveVariables on instcombine at -O0 -g from 0.3855s to 0.3503s. Look for more improvements in this area soon! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52804 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -780,6 +780,7 @@ bool MachineInstr::addRegisterDead(unsigned IncomingReg,
|
|||||||
const TargetRegisterInfo *RegInfo,
|
const TargetRegisterInfo *RegInfo,
|
||||||
bool AddIfNotFound) {
|
bool AddIfNotFound) {
|
||||||
bool isPhysReg = TargetRegisterInfo::isPhysicalRegister(IncomingReg);
|
bool isPhysReg = TargetRegisterInfo::isPhysicalRegister(IncomingReg);
|
||||||
|
bool hasAliases = isPhysReg && RegInfo->getAliasSet(IncomingReg) == 0;
|
||||||
bool Found = false;
|
bool Found = false;
|
||||||
SmallVector<unsigned,4> DeadOps;
|
SmallVector<unsigned,4> DeadOps;
|
||||||
for (unsigned i = 0, e = getNumOperands(); i != e; ++i) {
|
for (unsigned i = 0, e = getNumOperands(); i != e; ++i) {
|
||||||
@ -790,7 +791,7 @@ bool MachineInstr::addRegisterDead(unsigned IncomingReg,
|
|||||||
if (Reg == IncomingReg) {
|
if (Reg == IncomingReg) {
|
||||||
MO.setIsDead();
|
MO.setIsDead();
|
||||||
Found = true;
|
Found = true;
|
||||||
} else if (isPhysReg && MO.isDead() &&
|
} else if (hasAliases && MO.isDead() &&
|
||||||
TargetRegisterInfo::isPhysicalRegister(Reg)) {
|
TargetRegisterInfo::isPhysicalRegister(Reg)) {
|
||||||
// There exists a super-register that's marked dead.
|
// There exists a super-register that's marked dead.
|
||||||
if (RegInfo->isSuperRegister(IncomingReg, Reg))
|
if (RegInfo->isSuperRegister(IncomingReg, Reg))
|
||||||
|
Reference in New Issue
Block a user