mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-12 13:38:21 +00:00
Revert "IR: MDNode => Value"
Instead, we're going to separate metadata from the Value hierarchy. See PR21532. This reverts commit r221375. This reverts commit r221373. This reverts commit r221359. This reverts commit r221167. This reverts commit r221027. This reverts commit r221024. This reverts commit r221023. This reverts commit r220995. This reverts commit r220994. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221711 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -297,9 +297,9 @@ static void CloneAliasScopeMetadata(CallSite CS, ValueToValueMapTy &VMap) {
|
||||
for (Function::const_iterator I = CalledFunc->begin(), IE = CalledFunc->end();
|
||||
I != IE; ++I)
|
||||
for (BasicBlock::const_iterator J = I->begin(), JE = I->end(); J != JE; ++J) {
|
||||
if (const MDNode *M = J->getMDNode(LLVMContext::MD_alias_scope))
|
||||
if (const MDNode *M = J->getMetadata(LLVMContext::MD_alias_scope))
|
||||
MD.insert(M);
|
||||
if (const MDNode *M = J->getMDNode(LLVMContext::MD_noalias))
|
||||
if (const MDNode *M = J->getMetadata(LLVMContext::MD_noalias))
|
||||
MD.insert(M);
|
||||
}
|
||||
|
||||
@ -359,31 +359,32 @@ static void CloneAliasScopeMetadata(CallSite CS, ValueToValueMapTy &VMap) {
|
||||
if (!NI)
|
||||
continue;
|
||||
|
||||
if (MDNode *M = NI->getMDNode(LLVMContext::MD_alias_scope)) {
|
||||
if (MDNode *M = NI->getMetadata(LLVMContext::MD_alias_scope)) {
|
||||
MDNode *NewMD = MDMap[M];
|
||||
// If the call site also had alias scope metadata (a list of scopes to
|
||||
// which instructions inside it might belong), propagate those scopes to
|
||||
// the inlined instructions.
|
||||
if (MDNode *CSM =
|
||||
CS.getInstruction()->getMDNode(LLVMContext::MD_alias_scope))
|
||||
CS.getInstruction()->getMetadata(LLVMContext::MD_alias_scope))
|
||||
NewMD = MDNode::concatenate(NewMD, CSM);
|
||||
NI->setMetadata(LLVMContext::MD_alias_scope, NewMD);
|
||||
} else if (NI->mayReadOrWriteMemory()) {
|
||||
if (MDNode *M =
|
||||
CS.getInstruction()->getMDNode(LLVMContext::MD_alias_scope))
|
||||
CS.getInstruction()->getMetadata(LLVMContext::MD_alias_scope))
|
||||
NI->setMetadata(LLVMContext::MD_alias_scope, M);
|
||||
}
|
||||
|
||||
if (MDNode *M = NI->getMDNode(LLVMContext::MD_noalias)) {
|
||||
if (MDNode *M = NI->getMetadata(LLVMContext::MD_noalias)) {
|
||||
MDNode *NewMD = MDMap[M];
|
||||
// If the call site also had noalias metadata (a list of scopes with
|
||||
// which instructions inside it don't alias), propagate those scopes to
|
||||
// the inlined instructions.
|
||||
if (MDNode *CSM = CS.getInstruction()->getMDNode(LLVMContext::MD_noalias))
|
||||
if (MDNode *CSM =
|
||||
CS.getInstruction()->getMetadata(LLVMContext::MD_noalias))
|
||||
NewMD = MDNode::concatenate(NewMD, CSM);
|
||||
NI->setMetadata(LLVMContext::MD_noalias, NewMD);
|
||||
} else if (NI->mayReadOrWriteMemory()) {
|
||||
if (MDNode *M = CS.getInstruction()->getMDNode(LLVMContext::MD_noalias))
|
||||
if (MDNode *M = CS.getInstruction()->getMetadata(LLVMContext::MD_noalias))
|
||||
NI->setMetadata(LLVMContext::MD_noalias, M);
|
||||
}
|
||||
}
|
||||
@ -589,7 +590,7 @@ static void AddAliasScopeMetadata(CallSite CS, ValueToValueMapTy &VMap,
|
||||
if (!NoAliases.empty())
|
||||
NI->setMetadata(LLVMContext::MD_noalias,
|
||||
MDNode::concatenate(
|
||||
NI->getMDNode(LLVMContext::MD_noalias),
|
||||
NI->getMetadata(LLVMContext::MD_noalias),
|
||||
MDNode::get(CalledFunc->getContext(), NoAliases)));
|
||||
|
||||
// Next, we want to figure out all of the sets to which we might belong.
|
||||
@ -615,7 +616,7 @@ static void AddAliasScopeMetadata(CallSite CS, ValueToValueMapTy &VMap,
|
||||
if (!Scopes.empty())
|
||||
NI->setMetadata(
|
||||
LLVMContext::MD_alias_scope,
|
||||
MDNode::concatenate(NI->getMDNode(LLVMContext::MD_alias_scope),
|
||||
MDNode::concatenate(NI->getMetadata(LLVMContext::MD_alias_scope),
|
||||
MDNode::get(CalledFunc->getContext(), Scopes)));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user