resolve a fixme by using hte new flag.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97420 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2010-02-28 21:56:16 +00:00
parent ff7fb60f2a
commit 623a2e84fb

View File

@ -889,17 +889,15 @@ SDNode *SelectCodeCommon(SDNode *NodeToMatch, const unsigned char *MatcherTable,
Res->setNodeId(-1);
}
// FIXME: Whether the selected node has a flag result should come from
// flags on the node.
unsigned ResNumResults = Res->getNumValues();
if (Res->getValueType(ResNumResults-1) == MVT::Flag) {
// Move the flag if needed.
if (OldFlagResultNo != -1 &&
(unsigned)OldFlagResultNo != ResNumResults-1)
ReplaceUses(SDValue(NodeToMatch, OldFlagResultNo),
SDValue(Res, ResNumResults-1));
// Move the flag if needed.
if ((EmitNodeInfo & OPFL_FlagOutput) && OldFlagResultNo != -1 &&
(unsigned)OldFlagResultNo != ResNumResults-1)
ReplaceUses(SDValue(NodeToMatch, OldFlagResultNo),
SDValue(Res, ResNumResults-1));
if ((EmitNodeInfo & OPFL_FlagOutput) != 0)
--ResNumResults;
}
// Move the chain reference if needed.
if ((EmitNodeInfo & OPFL_Chain) && OldChainResultNo != -1 &&