From e67bde5bb1959dbd7085981cb0bcf6f7c749f724 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sun, 6 Jan 2008 05:36:50 +0000 Subject: 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 --- utils/TableGen/InstrInfoEmitter.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'utils/TableGen/InstrInfoEmitter.cpp') diff --git a/utils/TableGen/InstrInfoEmitter.cpp b/utils/TableGen/InstrInfoEmitter.cpp index d648721c37..4ab285f58f 100644 --- a/utils/TableGen/InstrInfoEmitter.cpp +++ b/utils/TableGen/InstrInfoEmitter.cpp @@ -176,8 +176,15 @@ private: // 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) -- cgit v1.2.3