diff options
author | Anton Afanasyev <anton.a.afanasyev@gmail.com> | 2019-11-29 14:22:10 +0300 |
---|---|---|
committer | Anton Afanasyev <anton.a.afanasyev@gmail.com> | 2020-01-06 11:05:15 +0300 |
commit | a7929533300535547f8484f7e38765234a7e7c93 (patch) | |
tree | 3ae8bc134bbe3c93de63e22cfe6aac14507c1bb8 /llvm/lib/IR | |
parent | ce67db4185374016a9f5745869f9dbedfc12e6d2 (diff) | |
download | bcm5719-llvm-a7929533300535547f8484f7e38765234a7e7c93.tar.gz bcm5719-llvm-a7929533300535547f8484f7e38765234a7e7c93.zip |
[Metadata] Add TBAA struct metadata to `AAMDNode`
Summary:
Make `AAMDNodes`' `getAAMetadata()` and `setAAMetadata()` to take `!tbaa.struct`
into account as well as `!tbaa`. This impacts llvm.org/pr42022.
This is a temprorary fix needed to keep `!tbaa.struct` tag by SROA pass.
New field `TBAAStruct` should be deleted when `!tbaa` tag replaces `!tbaa.struct`.
Merging two `!tbaa.struct`'s to one is conservatively considered to be `nullptr`
(giving `MayAlias`) -- this could be enhanced, but relying on the said future
replacement.
Reviewers: RKSimon, spatel, vporpo
Subscribers: hiraditya, kosarev, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D70924
Diffstat (limited to 'llvm/lib/IR')
-rw-r--r-- | llvm/lib/IR/Metadata.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/lib/IR/Metadata.cpp b/llvm/lib/IR/Metadata.cpp index 708a7daa09b..de092894d30 100644 --- a/llvm/lib/IR/Metadata.cpp +++ b/llvm/lib/IR/Metadata.cpp @@ -1262,6 +1262,7 @@ void Instruction::setMetadata(unsigned KindID, MDNode *Node) { void Instruction::setAAMetadata(const AAMDNodes &N) { setMetadata(LLVMContext::MD_tbaa, N.TBAA); + setMetadata(LLVMContext::MD_tbaa_struct, N.TBAAStruct); setMetadata(LLVMContext::MD_alias_scope, N.Scope); setMetadata(LLVMContext::MD_noalias, N.NoAlias); } |