MD_dereferenceable = 12, // "dereferenceable"
MD_dereferenceable_or_null = 13, // "dereferenceable_or_null"
MD_make_implicit = 14, // "make.implicit"
- MD_unpredictable = 15 // "unpredictable"
+ MD_unpredictable = 15, // "unpredictable"
+ MD_invariant_group = 16 // "invariant.group"
};
/// getMDKindID - Return a unique non-zero ID for the specified metadata kind.
}
void CodeGenPrepare::stripInvariantGroupMetadata(Instruction &I) {
- if (auto *InvariantMD = I.getMetadata("invariant.group"))
+ if (auto *InvariantMD = I.getMetadata(LLVMContext::MD_invariant_group))
I.dropUnknownNonDebugMetadata(InvariantMD->getMetadataID());
}
assert(UnpredictableID == MD_unpredictable &&
"unpredictable kind id drifted");
(void)UnpredictableID;
+
+ // Create the 'invariant.group' metadata kind.
+ unsigned InvariantGroupId = getMDKindID("invariant.group");
+ assert(InvariantGroupId == MD_invariant_group &&
+ "invariant.group kind id drifted");
+ (void)InvariantGroupId;
+
}
LLVMContext::~LLVMContext() { delete pImpl; }