set the 'isstore' flag for instructions whose pattern is an 
intrinsic that writes to memory.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45650 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/utils/TableGen/InstrInfoEmitter.cpp b/utils/TableGen/InstrInfoEmitter.cpp
index d648721..4ab285f 100644
--- a/utils/TableGen/InstrInfoEmitter.cpp
+++ b/utils/TableGen/InstrInfoEmitter.cpp
@@ -176,8 +176,15 @@
       // Get information about the SDNode for the operator.
       const SDNodeInfo &OpInfo = CDP.getSDNodeInfo(N->getOperator());
       
-      if (OpInfo.getEnumName() == "ISD::STORE")
+      // If this is a store node, it obviously stores to memory.
+      if (OpInfo.getEnumName() == "ISD::STORE") {
         isStore = true;
+        
+      } else if (const CodeGenIntrinsic *IntInfo = N->getIntrinsicInfo(CDP)) {
+        // If this is an intrinsic, analyze it.
+        if (IntInfo->ModRef >= CodeGenIntrinsic::WriteArgMem)
+          isStore = true;  // Intrinsics that can write to memory are 'isStore'.
+      }
     }
 
     for (unsigned i = 0, e = N->getNumChildren(); i != e; ++i)