From de36e8040fa72a8242de3fa4a2d663e1c8d0c225 Mon Sep 17 00:00:00 2001 From: "Duncan P. N. Exon Smith" Date: Tue, 11 Nov 2014 21:30:22 +0000 Subject: 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. llvm-svn: 221711 --- llvm/lib/Transforms/Utils/InlineFunction.cpp | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'llvm/lib/Transforms/Utils/InlineFunction.cpp') diff --git a/llvm/lib/Transforms/Utils/InlineFunction.cpp b/llvm/lib/Transforms/Utils/InlineFunction.cpp index a1e42bb..2d0b7dc 100644 --- a/llvm/lib/Transforms/Utils/InlineFunction.cpp +++ b/llvm/lib/Transforms/Utils/InlineFunction.cpp @@ -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))); } } -- cgit v1.1