Introduce enum values for previously defined metadata types. (NFC)

Our metadata scheme lazily assigns IDs to string metadata, but we have a mechanism to preassign them as well.  Using a preassigned ID is helpful since we get compile time type checking, and avoid some (minimal) string construction and comparison.  This change adds enum value for three existing metadata types:
+    MD_nontemporal = 9, // "nontemporal"
+    MD_mem_parallel_loop_access = 10, // "llvm.mem.parallel_loop_access"
+    MD_nonnull = 11 // "nonnull"

I went through an updated various uses as well.  I made no attempt to get all uses; I focused on the ones which were easily grepable and easily to translate.  For example, there were several items in LoopInfo.cpp I chose not to update.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220248 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Philip Reames
2014-10-21 00:13:20 +00:00
parent c0c4f1b78e
commit 9be9473394
8 changed files with 33 additions and 15 deletions
+1 -1
View File
@@ -2624,7 +2624,7 @@ bool llvm::isKnownNonNull(const Value *V, const TargetLibraryInfo *TLI) {
// A Load tagged w/nonnull metadata is never null.
if (const LoadInst *LI = dyn_cast<LoadInst>(V))
return LI->getMetadata("nonnull");
return LI->getMetadata(LLVMContext::MD_nonnull);
if (ImmutableCallSite CS = V)
if (CS.isReturnNonNull())