llvm.org GIT mirror llvm / 710e995
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 Chris Lattner 11 years ago
3 changed file(s) with 15 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
318318 Properties |= 1 << SDNPOptInFlag;
319319 } else if (PropList[i]->getName() == "SDNPMayStore") {
320320 Properties |= 1 << SDNPMayStore;
321 } else if (PropList[i]->getName() == "SDNPMayLoad") {
322 Properties |= 1 << SDNPMayLoad;
321323 } else {
322324 cerr << "Unknown SD Node property '" << PropList[i]->getName()
323325 << "' on node '" << R->getName() << "'!\n";
3636 SDNPOutFlag,
3737 SDNPInFlag,
3838 SDNPOptInFlag,
39 SDNPMayLoad,
3940 SDNPMayStore
4041 };
4142
173173 const SDNodeInfo &OpInfo = CDP.getSDNodeInfo(N->getOperator());
174174
175175 // If node writes to memory, it obviously stores to memory.
176 if (OpInfo.hasProperty(SDNPMayStore)) {
176 if (OpInfo.hasProperty(SDNPMayStore))
177177 mayStore = true;
178 } else if (const CodeGenIntrinsic *IntInfo = N->getIntrinsicInfo(CDP)) {
178
179 // If it reads memory, remember this.
180 if (OpInfo.hasProperty(SDNPMayLoad))
181 mayLoad = true;
182
183 if (const CodeGenIntrinsic *IntInfo = N->getIntrinsicInfo(CDP)) {
179184 // If this is an intrinsic, analyze it.
180 if (IntInfo->ModRef >= CodeGenIntrinsic::WriteArgMem)
185 if (IntInfo->ModRef >= CodeGenIntrinsic::WriteArgMem) {
181186 mayStore = true;// Intrinsics that can write to memory are 'mayStore'.
187 }
188
189 if (IntInfo->ModRef >= CodeGenIntrinsic::ReadArgMem)
190 mayLoad = true;// These may also load memory.
182191 }
183192 }
184193