diff options
author | Matt Arsenault <Matthew.Arsenault@amd.com> | 2024-11-26 06:13:34 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-26 09:13:34 -0500 |
commit | 4028bb10c3a396023b877d025c5776d207f29f91 (patch) | |
tree | 164149b96f396b700b058e9122543b6a447f6544 /llvm/lib/Transforms/Utils/Local.cpp | |
parent | f4d758634305304c0deb49a4ed3f99180a2488ea (diff) | |
download | llvm-4028bb10c3a396023b877d025c5776d207f29f91.zip llvm-4028bb10c3a396023b877d025c5776d207f29f91.tar.gz llvm-4028bb10c3a396023b877d025c5776d207f29f91.tar.bz2 |
Local: Handle noalias_addrspace in combineMetadata (#103938)
This should act like range.
Previously ConstantRangeList assumed a 64-bit range. Now query from the
actual entries. This also means that the empty range has no bitwidth, so
move asserts to avoid checking the bitwidth of empty ranges.
Diffstat (limited to 'llvm/lib/Transforms/Utils/Local.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/Local.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Utils/Local.cpp b/llvm/lib/Transforms/Utils/Local.cpp index b74d2e8..d574095 100644 --- a/llvm/lib/Transforms/Utils/Local.cpp +++ b/llvm/lib/Transforms/Utils/Local.cpp @@ -3391,6 +3391,11 @@ void llvm::combineMetadata(Instruction *K, const Instruction *J, if (DoesKMove) K->setMetadata(Kind, MDNode::getMergedProfMetadata(KMD, JMD, K, J)); break; + case LLVMContext::MD_noalias_addrspace: + if (DoesKMove) + K->setMetadata(Kind, + MDNode::getMostGenericNoaliasAddrspace(JMD, KMD)); + break; } } // Set !invariant.group from J if J has it. If both instructions have it @@ -3432,7 +3437,8 @@ void llvm::combineMetadataForCSE(Instruction *K, const Instruction *J, LLVMContext::MD_prof, LLVMContext::MD_nontemporal, LLVMContext::MD_noundef, - LLVMContext::MD_mmra}; + LLVMContext::MD_mmra, + LLVMContext::MD_noalias_addrspace}; combineMetadata(K, J, KnownIDs, KDominatesJ); } |