diff options
author | Chris Lattner <sabre@nondot.org> | 2008-01-10 04:38:57 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-01-10 04:38:57 +0000 |
commit | 22d3377d6b2f9c35033ef6ba1d4d0eef91e371eb (patch) | |
tree | 1a64294aab1e64785df2db1852218a46dd71f7a5 /utils/TableGen | |
parent | 41aed7365255a0b97464b53df03c642bb859738b (diff) | |
download | external_llvm-22d3377d6b2f9c35033ef6ba1d4d0eef91e371eb.zip external_llvm-22d3377d6b2f9c35033ef6ba1d4d0eef91e371eb.tar.gz external_llvm-22d3377d6b2f9c35033ef6ba1d4d0eef91e371eb.tar.bz2 |
realize that instructions who match intrinsics that read memory read memory.
Also, instructions with any nodes that are SDNPMayLoad also read memory.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45817 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/TableGen')
-rw-r--r-- | utils/TableGen/CodeGenDAGPatterns.cpp | 2 | ||||
-rw-r--r-- | utils/TableGen/CodeGenTarget.h | 1 | ||||
-rw-r--r-- | utils/TableGen/InstrInfoEmitter.cpp | 15 |
3 files changed, 15 insertions, 3 deletions
diff --git a/utils/TableGen/CodeGenDAGPatterns.cpp b/utils/TableGen/CodeGenDAGPatterns.cpp index 5a826cd..ee2d634 100644 --- a/utils/TableGen/CodeGenDAGPatterns.cpp +++ b/utils/TableGen/CodeGenDAGPatterns.cpp @@ -319,6 +319,8 @@ SDNodeInfo::SDNodeInfo(Record *R) : Def(R) { Properties |= 1 << SDNPOptInFlag; } else if (PropList[i]->getName() == "SDNPMayStore") { Properties |= 1 << SDNPMayStore; + } else if (PropList[i]->getName() == "SDNPMayLoad") { + Properties |= 1 << SDNPMayLoad; } else { cerr << "Unknown SD Node property '" << PropList[i]->getName() << "' on node '" << R->getName() << "'!\n"; diff --git a/utils/TableGen/CodeGenTarget.h b/utils/TableGen/CodeGenTarget.h index 02afe95..0740733 100644 --- a/utils/TableGen/CodeGenTarget.h +++ b/utils/TableGen/CodeGenTarget.h @@ -37,6 +37,7 @@ enum SDNP { SDNPOutFlag, SDNPInFlag, SDNPOptInFlag, + SDNPMayLoad, SDNPMayStore }; diff --git a/utils/TableGen/InstrInfoEmitter.cpp b/utils/TableGen/InstrInfoEmitter.cpp index 1c1973f..f4b9179 100644 --- a/utils/TableGen/InstrInfoEmitter.cpp +++ b/utils/TableGen/InstrInfoEmitter.cpp @@ -174,12 +174,21 @@ private: const SDNodeInfo &OpInfo = CDP.getSDNodeInfo(N->getOperator()); // If node writes to memory, it obviously stores to memory. - if (OpInfo.hasProperty(SDNPMayStore)) { + if (OpInfo.hasProperty(SDNPMayStore)) mayStore = true; - } else if (const CodeGenIntrinsic *IntInfo = N->getIntrinsicInfo(CDP)) { + + // If it reads memory, remember this. + if (OpInfo.hasProperty(SDNPMayLoad)) + mayLoad = true; + + if (const CodeGenIntrinsic *IntInfo = N->getIntrinsicInfo(CDP)) { // If this is an intrinsic, analyze it. - if (IntInfo->ModRef >= CodeGenIntrinsic::WriteArgMem) + if (IntInfo->ModRef >= CodeGenIntrinsic::WriteArgMem) { mayStore = true;// Intrinsics that can write to memory are 'mayStore'. + } + + if (IntInfo->ModRef >= CodeGenIntrinsic::ReadArgMem) + mayLoad = true;// These may also load memory. } } |