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 | e52c191890057ab4cec065505b0b27f8586eb1b5 (patch) | |
tree | c713798c01964fdb5e667374c5f276d9cec2795e /lib/CodeGen/MachineInstr.cpp | |
parent | 43f0c65e2533adfe6d4b2c199919516dbd402552 (diff) | |
download | external_llvm-e52c191890057ab4cec065505b0b27f8586eb1b5.zip external_llvm-e52c191890057ab4cec065505b0b27f8586eb1b5.tar.gz external_llvm-e52c191890057ab4cec065505b0b27f8586eb1b5.tar.bz2 |
- 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
Diffstat (limited to 'lib/CodeGen/MachineInstr.cpp')
-rw-r--r-- | lib/CodeGen/MachineInstr.cpp | 30 |
1 files changed, 3 insertions, 27 deletions
diff --git a/lib/CodeGen/MachineInstr.cpp b/lib/CodeGen/MachineInstr.cpp index 8e9933c..fe78828 100644 --- a/lib/CodeGen/MachineInstr.cpp +++ b/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); - } - } - } -} |