resolve a fixme by using hte new flag.
authorChris Lattner <sabre@nondot.org>
Sun, 28 Feb 2010 21:56:16 +0000 (21:56 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 28 Feb 2010 21:56:16 +0000 (21:56 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97420 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/CodeGen/DAGISelHeader.h

index 9aec982229a4e1bcad2c69eda021bf291e9db81b..51bb2f491539c82c3cec5610a840234bb5cc4a17 100644 (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 &&