summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAkira Hatanaka <ahatanaka@mips.com>2011-10-05 18:11:44 +0000
committerAkira Hatanaka <ahatanaka@mips.com>2011-10-05 18:11:44 +0000
commit14e4149f4ed7d8c63eb9c939e49bf1b6e0b3f39b (patch)
tree4a26690ad8008ce23357f218c1e00579d0c72ed2
parent38031978b5345b297f9b94c4c96ce6382c3656ac (diff)
downloadbcm5719-llvm-14e4149f4ed7d8c63eb9c939e49bf1b6e0b3f39b.tar.gz
bcm5719-llvm-14e4149f4ed7d8c63eb9c939e49bf1b6e0b3f39b.zip
Add RA to the set of registers that are defined if instruction is a call.
llvm-svn: 141194
-rw-r--r--llvm/lib/Target/Mips/MipsDelaySlotFiller.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/Target/Mips/MipsDelaySlotFiller.cpp b/llvm/lib/Target/Mips/MipsDelaySlotFiller.cpp
index 059c111edb1..b8443c1030b 100644
--- a/llvm/lib/Target/Mips/MipsDelaySlotFiller.cpp
+++ b/llvm/lib/Target/Mips/MipsDelaySlotFiller.cpp
@@ -218,13 +218,13 @@ void Filler::insertDefsUses(MachineBasicBlock::iterator MI,
SmallSet<unsigned, 32>& RegDefs,
SmallSet<unsigned, 32>& RegUses) {
// If MI is a call or return, just examine the explicit non-variadic operands.
- // NOTE: $ra is not added to RegDefs, since currently $ra is reserved and
- // no instruction that can possibly be put in a delay slot can read or
- // write it.
-
MCInstrDesc MCID = MI->getDesc();
unsigned e = MCID.isCall() || MCID.isReturn() ? MCID.getNumOperands() :
MI->getNumOperands();
+
+ // Add RA to RegDefs to prevent users of RA from going into delay slot.
+ if (MCID.isCall())
+ RegDefs.insert(Mips::RA);
for (unsigned i = 0; i != e; ++i) {
const MachineOperand &MO = MI->getOperand(i);
OpenPOWER on IntegriCloud