mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-10-25 10:27:04 +00:00
- Remove calls to copyKillDeadInfo which is an N^2 function. Instead, propagate kill / dead markers as new instructions are constructed in foldMemoryOperand, convertToThressAddress, etc.
- Also remove LiveVariables::instructionChanged, etc. Replace all calls with cheaper calls which update VarInfo kill list. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53097 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -647,9 +647,9 @@ void MachineInstr::copyPredicates(const MachineInstr *MI) {
|
||||
}
|
||||
}
|
||||
|
||||
/// isSafeToMove - Return true if it is safe to this instruction. If SawStore is
|
||||
/// set to true, it means that there is a store (or call) between the
|
||||
/// instruction's location and its intended destination.
|
||||
/// isSafeToMove - Return true if it is safe to move this instruction. If
|
||||
/// SawStore is set to true, it means that there is a store (or call) between
|
||||
/// the instruction's location and its intended destination.
|
||||
bool MachineInstr::isSafeToMove(const TargetInstrInfo *TII, bool &SawStore) {
|
||||
// Ignore stuff that we obviously can't move.
|
||||
if (TID->mayStore() || TID->isCall()) {
|
||||
@@ -829,27 +829,3 @@ bool MachineInstr::addRegisterDead(unsigned IncomingReg,
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/// copyKillDeadInfo - copies killed/dead information from one instr to another
|
||||
void MachineInstr::copyKillDeadInfo(MachineInstr *OldMI,
|
||||
const TargetRegisterInfo *RegInfo) {
|
||||
// If the instruction defines any virtual registers, update the VarInfo,
|
||||
// kill and dead information for the instruction.
|
||||
for (unsigned i = 0, e = OldMI->getNumOperands(); i != e; ++i) {
|
||||
MachineOperand &MO = OldMI->getOperand(i);
|
||||
if (MO.isRegister() && MO.getReg() &&
|
||||
TargetRegisterInfo::isVirtualRegister(MO.getReg())) {
|
||||
unsigned Reg = MO.getReg();
|
||||
if (MO.isDef()) {
|
||||
if (MO.isDead()) {
|
||||
MO.setIsDead(false);
|
||||
addRegisterDead(Reg, RegInfo);
|
||||
}
|
||||
}
|
||||
if (MO.isKill()) {
|
||||
MO.setIsKill(false);
|
||||
addRegisterKilled(Reg, RegInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user