[llvm] Metadata: Optimize metadata queries (PR #70700)

Matthias Braun via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 31 09:50:41 PDT 2023


================
@@ -1620,10 +1629,7 @@ void Instruction::setNoSanitizeMetadata() {
 }
 
 MDNode *Instruction::getMetadataImpl(unsigned KindID) const {
-  // Handle 'dbg' as a special case since it is not stored in the hash table.
-  if (KindID == LLVMContext::MD_dbg)
-    return DbgLoc.getAsMDNode();
-  return Value::getMetadata(KindID);
+  return getValueMetadata(*this, KindID, getContext());
----------------
MatzeB wrote:

Shuffled the functions around a bit and changed `getValueMetada` to a new `Value::getMetadataImpl` and removed `Instruction::getMetadataImpl` now.

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


More information about the llvm-commits mailing list