[llvm] [LLVM][MemCpyOpt] Unify alias tags if we optimize allocas (PR #129537)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Sun Apr 6 14:11:19 PDT 2025


================
@@ -1681,6 +1687,12 @@ bool MemCpyOptPass::performStackMoveOptzn(Instruction *Load, Instruction *Store,
   for (Instruction *I : NoAliasInstrs)
     I->setMetadata(LLVMContext::MD_noalias, nullptr);
 
+  // Remove !tbaa and !tbaa_struct from the metadata, since they are invalid.
+  for (Instruction *I : OptimizedAllocaInstUsers) {
----------------
nikic wrote:

Can we combine NoAliasInstrs and OptimizedAllocaInstUsers? The purpose is basically the same, I don't think we need separate sets for different metadata.

https://github.com/llvm/llvm-project/pull/129537


More information about the llvm-commits mailing list