Don't forget the existing root.

llvm-svn: 19531
This commit is contained in:
Chris Lattner 2005-01-13 19:53:14 +00:00
parent 74bc42304c
commit 2451684678
1 changed files with 2 additions and 4 deletions

View File

@ -878,10 +878,8 @@ void SelectionDAGISel::BuildSelectionDAG(SelectionDAG &DAG, BasicBlock *LLVMBB,
ConstantsOut.clear();
// Turn all of the unordered chains into one factored node.
switch (UnorderedChains.size()) {
case 0: break;
case 1: DAG.setRoot(UnorderedChains[0]); break;
default:
if (!UnorderedChains.empty()) {
UnorderedChains.push_back(DAG.getRoot());
DAG.setRoot(DAG.getNode(ISD::TokenFactor, MVT::Other, UnorderedChains));
}