[PATCH] D136503: Avoid repeated checks and context lookup in llvm::Instruction::getAAMetadata

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 21 14:47:01 PDT 2022


nikic accepted this revision.
nikic added a comment.
This revision is now accepted and ready to land.

LGTM

I think given that this lives in Metadata.cpp, the direct access the metadata internals is fine. If there are performance-critical external users of this kind, we could add an API that accepts multiple MDKinds and returns results for all of them.



================
Comment at: llvm/lib/IR/Metadata.cpp:1464
   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);
+  // Not using Instruction::hasMetadata() because we're not interesting in
+  // DebugInfoMetadata
----------------
interesting -> interested


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D136503/new/

https://reviews.llvm.org/D136503



More information about the llvm-commits mailing list