diff options
Diffstat (limited to 'include/llvm/IR/Metadata.h')
-rw-r--r-- | include/llvm/IR/Metadata.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/include/llvm/IR/Metadata.h b/include/llvm/IR/Metadata.h index 80ed44be43eba..3462cc02fd27f 100644 --- a/include/llvm/IR/Metadata.h +++ b/include/llvm/IR/Metadata.h @@ -660,6 +660,19 @@ struct AAMDNodes { /// \brief The tag specifying the noalias scope. MDNode *NoAlias; + + /// \brief Given two sets of AAMDNodes that apply to the same pointer, + /// give the best AAMDNodes that are compatible with both (i.e. a set of + /// nodes whose allowable aliasing conclusions are a subset of those + /// allowable by both of the inputs). However, for efficiency + /// reasons, do not create any new MDNodes. + AAMDNodes intersect(const AAMDNodes &Other) { + AAMDNodes Result; + Result.TBAA = Other.TBAA == TBAA ? TBAA : nullptr; + Result.Scope = Other.Scope == Scope ? Scope : nullptr; + Result.NoAlias = Other.NoAlias == NoAlias ? NoAlias : nullptr; + return Result; + } }; // Specialize DenseMapInfo for AAMDNodes. |