mirror of
https://github.com/RPCSX/llvm.git
synced 2025-02-13 09:14:38 +00:00
The lastOp operand is never used
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9331 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
91480ffbe2
commit
d48a1d797f
@ -81,7 +81,7 @@ namespace {
|
|||||||
//
|
//
|
||||||
// visitOneOperand() does all the work for one operand.
|
// visitOneOperand() does all the work for one operand.
|
||||||
//
|
//
|
||||||
void visitOperands(Instruction &I, int firstOp=0, int lastOp=0);
|
void visitOperands(Instruction &I, int firstOp=0);
|
||||||
void visitOneOperand(Instruction &I, Value* Op, unsigned opNum,
|
void visitOneOperand(Instruction &I, Value* Op, unsigned opNum,
|
||||||
Instruction& insertBefore);
|
Instruction& insertBefore);
|
||||||
};
|
};
|
||||||
@ -208,29 +208,20 @@ PreSelection::visitOneOperand(Instruction &I, Value* Op, unsigned opNum,
|
|||||||
// firstOp and lastOp can be used to skip leading and trailing operands.
|
// firstOp and lastOp can be used to skip leading and trailing operands.
|
||||||
// If lastOp is 0, it defaults to #operands or #incoming Phi values.
|
// If lastOp is 0, it defaults to #operands or #incoming Phi values.
|
||||||
//
|
//
|
||||||
inline void
|
inline void PreSelection::visitOperands(Instruction &I, int firstOp) {
|
||||||
PreSelection::visitOperands(Instruction &I, int firstOp, int lastOp)
|
|
||||||
{
|
|
||||||
// For any instruction other than PHI, copies go just before the instr.
|
// For any instruction other than PHI, copies go just before the instr.
|
||||||
// For a PHI, operand copies must be before the terminator of the
|
// For a PHI, operand copies must be before the terminator of the
|
||||||
// appropriate predecessor basic block. Remaining logic is simple
|
// appropriate predecessor basic block. Remaining logic is simple
|
||||||
// so just handle PHIs and other instructions separately.
|
// so just handle PHIs and other instructions separately.
|
||||||
//
|
//
|
||||||
if (PHINode* phi = dyn_cast<PHINode>(&I))
|
if (PHINode* phi = dyn_cast<PHINode>(&I)) {
|
||||||
{
|
for (unsigned i=firstOp, N=phi->getNumIncomingValues(); i != N; ++i)
|
||||||
if (lastOp == 0)
|
visitOneOperand(I, phi->getIncomingValue(i),
|
||||||
lastOp = phi->getNumIncomingValues();
|
|
||||||
for (unsigned i=firstOp, N=lastOp; i < N; ++i)
|
|
||||||
this->visitOneOperand(I, phi->getIncomingValue(i),
|
|
||||||
phi->getOperandNumForIncomingValue(i),
|
phi->getOperandNumForIncomingValue(i),
|
||||||
* phi->getIncomingBlock(i)->getTerminator());
|
* phi->getIncomingBlock(i)->getTerminator());
|
||||||
}
|
} else {
|
||||||
else
|
for (unsigned i=firstOp, N=lastOp; i != I.getNumOperands(); ++i)
|
||||||
{
|
visitOneOperand(I, I.getOperand(i), i, I);
|
||||||
if (lastOp == 0)
|
|
||||||
lastOp = I.getNumOperands();
|
|
||||||
for (unsigned i=firstOp, N=lastOp; i < N; ++i)
|
|
||||||
this->visitOneOperand(I, I.getOperand(i), i, I);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user