[IR] Re-group AAMDNodes relevant interfaces. NFC.

This commit is contained in:
Michael Liao 2021-09-21 14:09:06 -04:00
parent 131e878664
commit 2d1ffad010
3 changed files with 13 additions and 13 deletions

View File

@ -307,9 +307,6 @@ public:
Value::getAllMetadata(MDs);
}
/// Returns the AA metadata for this instruction.
AAMDNodes getAAMetadata() const;
/// Set the metadata of the specified kind to the specified node. This updates
/// or replaces metadata if already present, or removes it if Node is null.
void setMetadata(unsigned KindID, MDNode *Node);
@ -350,7 +347,10 @@ public:
/// to the existing node.
void addAnnotationMetadata(StringRef Annotation);
/// Sets the metadata on this instruction from the AAMDNodes structure.
/// Returns the AA metadata for this instruction.
AAMDNodes getAAMetadata() const;
/// Sets the AA metadata on this instruction from the AAMDNodes structure.
void setAAMetadata(const AAMDNodes &N);
/// Retrieve the raw weight values of a conditional branch or select.

View File

@ -538,15 +538,6 @@ AAMDNodes AAMDNodes::concat(const AAMDNodes &Other) const {
return Result;
}
AAMDNodes Instruction::getAAMetadata() const {
AAMDNodes Result;
Result.TBAA = getMetadata(LLVMContext::MD_tbaa);
Result.TBAAStruct = getMetadata(LLVMContext::MD_tbaa_struct);
Result.Scope = getMetadata(LLVMContext::MD_alias_scope);
Result.NoAlias = getMetadata(LLVMContext::MD_noalias);
return Result;
}
static const MDNode *createAccessTag(const MDNode *AccessType) {
// If there is no access type or the access type is the root node, then
// we don't have any useful access tag to return.

View File

@ -1367,6 +1367,15 @@ void Instruction::addAnnotationMetadata(StringRef Name) {
setMetadata(LLVMContext::MD_annotation, MD);
}
AAMDNodes Instruction::getAAMetadata() const {
AAMDNodes Result;
Result.TBAA = getMetadata(LLVMContext::MD_tbaa);
Result.TBAAStruct = getMetadata(LLVMContext::MD_tbaa_struct);
Result.Scope = getMetadata(LLVMContext::MD_alias_scope);
Result.NoAlias = getMetadata(LLVMContext::MD_noalias);
return Result;
}
void Instruction::setAAMetadata(const AAMDNodes &N) {
setMetadata(LLVMContext::MD_tbaa, N.TBAA);
setMetadata(LLVMContext::MD_tbaa_struct, N.TBAAStruct);