summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/Mips/MipsInstrInfo.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/Target/Mips/MipsInstrInfo.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/Target/Mips/MipsInstrInfo.cpp')
-rw-r--r--llvm/lib/Target/Mips/MipsInstrInfo.cpp18
1 files changed, 11 insertions, 7 deletions
diff --git a/llvm/lib/Target/Mips/MipsInstrInfo.cpp b/llvm/lib/Target/Mips/MipsInstrInfo.cpp
index fa5d8b3bd77..c7bc1e9076b 100644
--- a/llvm/lib/Target/Mips/MipsInstrInfo.cpp
+++ b/llvm/lib/Target/Mips/MipsInstrInfo.cpp
@@ -386,18 +386,22 @@ foldMemoryOperand(MachineFunction &MF,
(MI->getOperand(1).getReg() == Mips::ZERO) &&
(MI->getOperand(2).isRegister()))
{
- if (Ops[0] == 0) // COPY -> STORE
+ if (Ops[0] == 0) { // COPY -> STORE
+ unsigned SrcReg = MI->getOperand(2).getReg();
+ bool isKill = MI->getOperand(2).isKill();
NewMI = BuildMI(get(Mips::SW)).addFrameIndex(FI)
- .addImm(0).addReg(MI->getOperand(2).getReg());
- else // COPY -> LOAD
- NewMI = BuildMI(get(Mips::LW), MI->getOperand(0)
- .getReg()).addImm(0).addFrameIndex(FI);
+ .addImm(0).addReg(SrcReg, false, false, isKill);
+ } else { // COPY -> LOAD
+ unsigned DstReg = MI->getOperand(0).getReg();
+ bool isDead = MI->getOperand(0).isDead();
+ NewMI = BuildMI(get(Mips::LW))
+ .addReg(DstReg, true, false, false, isDead)
+ .addImm(0).addFrameIndex(FI);
+ }
}
break;
}
- if (NewMI)
- NewMI->copyKillDeadInfo(MI);
return NewMI;
}
OpenPOWER on IntegriCloud