mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-03-27 14:32:21 +00:00
Simplify this code; use a while instead of an if and a do-while.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67400 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
697cbbfb00
commit
db95fa131a
@ -105,18 +105,15 @@ void ScheduleDAGSDNodes::BuildSchedUnits() {
|
||||
|
||||
// See if anything is flagged to this node, if so, add them to flagged
|
||||
// nodes. Nodes can have at most one flag input and one flag output. Flags
|
||||
// are required the be the last operand and result of a node.
|
||||
// are required to be the last operand and result of a node.
|
||||
|
||||
// Scan up to find flagged preds.
|
||||
SDNode *N = NI;
|
||||
if (N->getNumOperands() &&
|
||||
N->getOperand(N->getNumOperands()-1).getValueType() == MVT::Flag) {
|
||||
do {
|
||||
N = N->getOperand(N->getNumOperands()-1).getNode();
|
||||
assert(N->getNodeId() == -1 && "Node already inserted!");
|
||||
N->setNodeId(NodeSUnit->NodeNum);
|
||||
} while (N->getNumOperands() &&
|
||||
N->getOperand(N->getNumOperands()-1).getValueType()== MVT::Flag);
|
||||
while (N->getNumOperands() &&
|
||||
N->getOperand(N->getNumOperands()-1).getValueType() == MVT::Flag) {
|
||||
N = N->getOperand(N->getNumOperands()-1).getNode();
|
||||
assert(N->getNodeId() == -1 && "Node already inserted!");
|
||||
N->setNodeId(NodeSUnit->NodeNum);
|
||||
}
|
||||
|
||||
// Scan down to find any flagged succs.
|
||||
|
Loading…
x
Reference in New Issue
Block a user