aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVikram S. Adve <vadve@cs.uiuc.edu>2001-10-14 23:28:43 +0000
committerVikram S. Adve <vadve@cs.uiuc.edu>2001-10-14 23:28:43 +0000
commitc025fc10836da6af7e456a77f32d57c7d636da79 (patch)
tree1eabba0b282bc40f1828e443cdb68eea7d2e1e3d
parentb847f51bc83972178f29fe3634f38d6bfdc43bfd (diff)
Forward operands into implicit uses as well as explicit ones.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@808 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Target/SparcV9/SparcV9InstrSelection.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/Target/SparcV9/SparcV9InstrSelection.cpp b/lib/Target/SparcV9/SparcV9InstrSelection.cpp
index d303f8eb90..25b1d7b748 100644
--- a/lib/Target/SparcV9/SparcV9InstrSelection.cpp
+++ b/lib/Target/SparcV9/SparcV9InstrSelection.cpp
@@ -290,7 +290,6 @@ ChooseMovpccAfterSub(const InstructionNode* instrNode,
return opCode;
}
-
static inline MachineOpCode
ChooseConvertToFloatInstr(const InstructionNode* instrNode,
const Type* opType)
@@ -1277,7 +1276,8 @@ FixConstantOperands(const InstructionNode* vmInstrNode,
//
// Substitute operand `operandNum' of the instruction in node `treeNode'
-// in place the use(s) of that instruction in node `parent'.
+// in place of the use(s) of that instruction in node `parent'.
+// Check both explicit and implicit operands!
//
static void
ForwardOperand(InstructionNode* treeNode,
@@ -1302,7 +1302,8 @@ ForwardOperand(InstructionNode* treeNode,
for (unsigned i=0, N=mvec.size(); i < N; i++)
{
MachineInstr* minstr = mvec[i];
- for (unsigned i=0, numOps=minstr->getNumOperands(); i < numOps; i++)
+
+ for (unsigned i=0, numOps=minstr->getNumOperands(); i < numOps; ++i)
{
const MachineOperand& mop = minstr->getOperand(i);
if (mop.getOperandType() == MachineOperand::MO_VirtualRegister &&
@@ -1312,6 +1313,10 @@ ForwardOperand(InstructionNode* treeNode,
fwdOp);
}
}
+
+ for (unsigned i=0, numOps=minstr->getNumImplicitRefs(); i < numOps; ++i)
+ if (minstr->getImplicitRef(i) == unusedOp)
+ minstr->setImplicitRef(i, fwdOp, minstr->implicitRefIsDefined(i));
}
}