diff options
Diffstat (limited to 'llvm/utils/TableGen/InstrInfoEmitter.cpp')
-rw-r--r-- | llvm/utils/TableGen/InstrInfoEmitter.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/llvm/utils/TableGen/InstrInfoEmitter.cpp b/llvm/utils/TableGen/InstrInfoEmitter.cpp index 1c1973f9a50..f4b9179cd0d 100644 --- a/llvm/utils/TableGen/InstrInfoEmitter.cpp +++ b/llvm/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. } } |