summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/MachineInstr.cpp
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2008-07-03 09:09:37 +0000
committerEvan Cheng <evan.cheng@apple.com>2008-07-03 09:09:37 +0000
commit7d98a48f15c208f6b0ccfd772284a2d2738a9b98 (patch)
tree7e60a965704fbc87ff3f36bc4d50c35aef74cab0 /llvm/lib/CodeGen/MachineInstr.cpp
parent798d9bb97ff93570b9bae371e28039a5ec20364e (diff)
downloadbcm5719-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.cpp30
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);
- }
- }
- }
-}
OpenPOWER on IntegriCloud