mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-14 14:24:05 +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:
@ -128,7 +128,7 @@ bool llvm::ConstantFoldTerminator(BasicBlock *BB, bool DeleteDeadConditions,
|
||||
// Check to see if this branch is going to the same place as the default
|
||||
// dest. If so, eliminate it as an explicit compare.
|
||||
if (i.getCaseSuccessor() == DefaultDest) {
|
||||
MDNode *MD = SI->getMDNode(LLVMContext::MD_prof);
|
||||
MDNode *MD = SI->getMetadata(LLVMContext::MD_prof);
|
||||
unsigned NCases = SI->getNumCases();
|
||||
// Fold the case metadata into the default if there will be any branches
|
||||
// left, unless the metadata doesn't match the switch.
|
||||
@ -206,7 +206,7 @@ bool llvm::ConstantFoldTerminator(BasicBlock *BB, bool DeleteDeadConditions,
|
||||
BranchInst *NewBr = Builder.CreateCondBr(Cond,
|
||||
FirstCase.getCaseSuccessor(),
|
||||
SI->getDefaultDest());
|
||||
MDNode *MD = SI->getMDNode(LLVMContext::MD_prof);
|
||||
MDNode *MD = SI->getMetadata(LLVMContext::MD_prof);
|
||||
if (MD && MD->getNumOperands() == 3) {
|
||||
ConstantInt *SICase = dyn_cast<ConstantInt>(MD->getOperand(2));
|
||||
ConstantInt *SIDef = dyn_cast<ConstantInt>(MD->getOperand(1));
|
||||
@ -1308,13 +1308,13 @@ bool llvm::removeUnreachableBlocks(Function &F) {
|
||||
}
|
||||
|
||||
void llvm::combineMetadata(Instruction *K, const Instruction *J, ArrayRef<unsigned> KnownIDs) {
|
||||
SmallVector<std::pair<unsigned, Value *>, 4> Metadata;
|
||||
SmallVector<std::pair<unsigned, MDNode *>, 4> Metadata;
|
||||
K->dropUnknownMetadata(KnownIDs);
|
||||
K->getAllMetadataOtherThanDebugLoc(Metadata);
|
||||
for (unsigned i = 0, n = Metadata.size(); i < n; ++i) {
|
||||
unsigned Kind = Metadata[i].first;
|
||||
MDNode *JMD = J->getMDNode(Kind);
|
||||
MDNode *KMD = cast<MDNode>(Metadata[i].second);
|
||||
MDNode *JMD = J->getMetadata(Kind);
|
||||
MDNode *KMD = Metadata[i].second;
|
||||
|
||||
switch (Kind) {
|
||||
default:
|
||||
|
Reference in New Issue
Block a user