Implement proper handling for pcmpistri/pcmpestri intrinsics. Requires custom handlin...
[oota-llvm.git] / utils / TableGen / DAGISelMatcherGen.cpp
index 2ac7b87e7010e423656b7e3488571483b2a411b5..aed222c094956c4f18f20c2215c6ad9af81f2593 100644 (file)
@@ -690,6 +690,13 @@ EmitResultInstructionAsOperand(const TreePatternNode *N,
   bool NodeHasChain = InstPatNode &&
                       InstPatNode->TreeHasProperty(SDNPHasChain, CGP);
 
+  // Instructions which load and store from memory should have a chain,
+  // regardless of whether they happen to have an internal pattern saying so.
+  if (Pattern.getSrcPattern()->TreeHasProperty(SDNPHasChain, CGP)
+      && (II.hasCtrlDep || II.mayLoad || II.mayStore || II.canFoldAsLoad ||
+          II.hasSideEffects))
+      NodeHasChain = true;
+
   bool isRoot = N == Pattern.getDstPattern();
 
   // TreeHasOutGlue - True if this tree has glue.