<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">LGTM<br>
<br>
On 09/17/2015 12:34 AM, Piotr Padlewski via llvm-commits wrote:<br>
</div>
<blockquote
cite="mid:differential-rev-PHID-DREV-akq4pwuxmn5el2u5g6cv-req@reviews.llvm.org"
type="cite">
<pre wrap="">Prazek created this revision.
Prazek added reviewers: rsmith, nlewycky, majnemer.
Prazek added a subscriber: llvm-commits.
<a class="moz-txt-link-freetext" href="http://reviews.llvm.org/D12926">http://reviews.llvm.org/D12926</a>
Files:
include/llvm/IR/LLVMContext.h
lib/CodeGen/CodeGenPrepare.cpp
lib/IR/LLVMContext.cpp
Index: lib/IR/LLVMContext.cpp
===================================================================
--- lib/IR/LLVMContext.cpp
+++ lib/IR/LLVMContext.cpp
@@ -116,6 +116,13 @@
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; }
Index: lib/CodeGen/CodeGenPrepare.cpp
===================================================================
--- lib/CodeGen/CodeGenPrepare.cpp
+++ lib/CodeGen/CodeGenPrepare.cpp
@@ -4836,6 +4836,6 @@
}
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());
}
Index: include/llvm/IR/LLVMContext.h
===================================================================
--- include/llvm/IR/LLVMContext.h
+++ include/llvm/IR/LLVMContext.h
@@ -62,7 +62,8 @@
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.
</pre>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
llvm-commits mailing list
<a class="moz-txt-link-abbreviated" href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a>
<a class="moz-txt-link-freetext" href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a>
</pre>
</blockquote>
<br>
</body>
</html>