mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-10 17:29:44 +00:00
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
This commit is contained in:
parent
8794390406
commit
710e995889
@ -319,6 +319,8 @@ SDNodeInfo::SDNodeInfo(Record *R) : Def(R) {
|
|||||||
Properties |= 1 << SDNPOptInFlag;
|
Properties |= 1 << SDNPOptInFlag;
|
||||||
} else if (PropList[i]->getName() == "SDNPMayStore") {
|
} else if (PropList[i]->getName() == "SDNPMayStore") {
|
||||||
Properties |= 1 << SDNPMayStore;
|
Properties |= 1 << SDNPMayStore;
|
||||||
|
} else if (PropList[i]->getName() == "SDNPMayLoad") {
|
||||||
|
Properties |= 1 << SDNPMayLoad;
|
||||||
} else {
|
} else {
|
||||||
cerr << "Unknown SD Node property '" << PropList[i]->getName()
|
cerr << "Unknown SD Node property '" << PropList[i]->getName()
|
||||||
<< "' on node '" << R->getName() << "'!\n";
|
<< "' on node '" << R->getName() << "'!\n";
|
||||||
|
@ -37,6 +37,7 @@ enum SDNP {
|
|||||||
SDNPOutFlag,
|
SDNPOutFlag,
|
||||||
SDNPInFlag,
|
SDNPInFlag,
|
||||||
SDNPOptInFlag,
|
SDNPOptInFlag,
|
||||||
|
SDNPMayLoad,
|
||||||
SDNPMayStore
|
SDNPMayStore
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -174,12 +174,21 @@ private:
|
|||||||
const SDNodeInfo &OpInfo = CDP.getSDNodeInfo(N->getOperator());
|
const SDNodeInfo &OpInfo = CDP.getSDNodeInfo(N->getOperator());
|
||||||
|
|
||||||
// If node writes to memory, it obviously stores to memory.
|
// If node writes to memory, it obviously stores to memory.
|
||||||
if (OpInfo.hasProperty(SDNPMayStore)) {
|
if (OpInfo.hasProperty(SDNPMayStore))
|
||||||
mayStore = true;
|
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 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'.
|
mayStore = true;// Intrinsics that can write to memory are 'mayStore'.
|
||||||
|
}
|
||||||
|
|
||||||
|
if (IntInfo->ModRef >= CodeGenIntrinsic::ReadArgMem)
|
||||||
|
mayLoad = true;// These may also load memory.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user