[llvm] Metadata: Optimize metadata queries (PR #70700)
Jeremy Morse via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 31 04:09:43 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());
----------------
jmorse wrote:
Could you leave a comment here indicting the assumptions of this method (non-'dbg', already checked metadata is present), it'll make it easier for those who aren't familiar with the Metadata hierarchy to understand what's going on.
https://github.com/llvm/llvm-project/pull/70700
More information about the llvm-commits
mailing list