diff options
author | Evan Cheng <evan.cheng@apple.com> | 2008-07-03 09:09:37 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2008-07-03 09:09:37 +0000 |
commit | 7d98a48f15c208f6b0ccfd772284a2d2738a9b98 (patch) | |
tree | 7e60a965704fbc87ff3f36bc4d50c35aef74cab0 /llvm/lib/CodeGen/MachineInstr.cpp | |
parent | 798d9bb97ff93570b9bae371e28039a5ec20364e (diff) | |
download | bcm5719-llvm-7d98a48f15c208f6b0ccfd772284a2d2738a9b98.tar.gz bcm5719-llvm-7d98a48f15c208f6b0ccfd772284a2d2738a9b98.zip |
- 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.
llvm-svn: 53097
Diffstat (limited to 'llvm/lib/CodeGen/MachineInstr.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineInstr.cpp | 30 |
1 files changed, 3 insertions, 27 deletions
diff --git a/llvm/lib/CodeGen/MachineInstr.cpp b/llvm/lib/CodeGen/MachineInstr.cpp index 8e9933c7a73..fe78828410c 100644 --- a/llvm/lib/CodeGen/MachineInstr.cpp +++ b/llvm/lib/CodeGen/MachineInstr.cpp @@ -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); - } - } - } -} |