summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorEli Bendersky <eliben@google.com>2014-06-25 15:42:16 +0000
committerEli Bendersky <eliben@google.com>2014-06-25 15:42:16 +0000
commit713c1eaed4018e4c3ec5a64114a1c8bb4e240eb9 (patch)
treeea5d3a185aa12930e6841e7c8ed1d8c737017abb /lib
parent3d34ffaa95ad22393234dd26b3622bd0ce6928cf (diff)
downloadclang-713c1eaed4018e4c3ec5a64114a1c8bb4e240eb9.tar.gz
clang-713c1eaed4018e4c3ec5a64114a1c8bb4e240eb9.tar.bz2
clang-713c1eaed4018e4c3ec5a64114a1c8bb4e240eb9.tar.xz
Rename loop unrolling and loop vectorizer metadata to have a common prefix.
[Clang part] These patches rename the loop unrolling and loop vectorizer metadata such that they have a common 'llvm.loop.' prefix. Metadata name changes: llvm.vectorizer.* => llvm.loop.vectorizer.* llvm.loopunroll.* => llvm.loop.unroll.* This was a suggestion from an earlier review (http://reviews.llvm.org/D4090) which added the loop unrolling metadata. Patch by Mark Heffernan. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@211712 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/CodeGen/CGLoopInfo.cpp6
-rw-r--r--lib/CodeGen/CGLoopInfo.h8
-rw-r--r--lib/CodeGen/CGStmt.cpp12
3 files changed, 13 insertions, 13 deletions
diff --git a/lib/CodeGen/CGLoopInfo.cpp b/lib/CodeGen/CGLoopInfo.cpp
index 7b154b2d27..1bc6d20158 100644
--- a/lib/CodeGen/CGLoopInfo.cpp
+++ b/lib/CodeGen/CGLoopInfo.cpp
@@ -31,7 +31,7 @@ static MDNode *createMetadata(LLVMContext &Ctx, const LoopAttributes &Attrs) {
// Setting vectorizer.width
if (Attrs.VectorizerWidth > 0) {
- Value *Vals[] = { MDString::get(Ctx, "llvm.vectorizer.width"),
+ Value *Vals[] = { MDString::get(Ctx, "llvm.loop.vectorize.width"),
ConstantInt::get(Type::getInt32Ty(Ctx),
Attrs.VectorizerWidth) };
Args.push_back(MDNode::get(Ctx, Vals));
@@ -39,7 +39,7 @@ static MDNode *createMetadata(LLVMContext &Ctx, const LoopAttributes &Attrs) {
// Setting vectorizer.unroll
if (Attrs.VectorizerUnroll > 0) {
- Value *Vals[] = { MDString::get(Ctx, "llvm.vectorizer.unroll"),
+ Value *Vals[] = { MDString::get(Ctx, "llvm.loop.vectorize.unroll"),
ConstantInt::get(Type::getInt32Ty(Ctx),
Attrs.VectorizerUnroll) };
Args.push_back(MDNode::get(Ctx, Vals));
@@ -47,7 +47,7 @@ static MDNode *createMetadata(LLVMContext &Ctx, const LoopAttributes &Attrs) {
// Setting vectorizer.enable
if (Attrs.VectorizerEnable != LoopAttributes::VecUnspecified) {
- Value *Vals[] = { MDString::get(Ctx, "llvm.vectorizer.enable"),
+ Value *Vals[] = { MDString::get(Ctx, "llvm.loop.vectorize.enable"),
ConstantInt::get(Type::getInt1Ty(Ctx),
(Attrs.VectorizerEnable ==
LoopAttributes::VecEnable)) };
diff --git a/lib/CodeGen/CGLoopInfo.h b/lib/CodeGen/CGLoopInfo.h
index f4a8dcae69..2461368336 100644
--- a/lib/CodeGen/CGLoopInfo.h
+++ b/lib/CodeGen/CGLoopInfo.h
@@ -37,16 +37,16 @@ struct LoopAttributes {
/// \brief Generate llvm.loop.parallel metadata for loads and stores.
bool IsParallel;
- /// \brief Values of llvm.vectorizer.enable metadata.
+ /// \brief Values of llvm.loop.vectorize.enable metadata.
enum LVEnableState { VecUnspecified, VecEnable, VecDisable };
- /// \brief llvm.vectorizer.enable
+ /// \brief llvm.loop.vectorize.enable
LVEnableState VectorizerEnable;
- /// \brief llvm.vectorizer.width
+ /// \brief llvm.loop.vectorize.width
unsigned VectorizerWidth;
- /// \brief llvm.vectorizer.unroll
+ /// \brief llvm.loop.vectorize.unroll
unsigned VectorizerUnroll;
};
diff --git a/lib/CodeGen/CGStmt.cpp b/lib/CodeGen/CGStmt.cpp
index cadfe399fa..3e49733a9c 100644
--- a/lib/CodeGen/CGStmt.cpp
+++ b/lib/CodeGen/CGStmt.cpp
@@ -534,7 +534,7 @@ void CodeGenFunction::EmitCondBrHints(llvm::LLVMContext &Context,
if (Attrs.empty())
return;
- // Add vectorize hints to the metadata on the conditional branch.
+ // Add vectorize and unroll hints to the metadata on the conditional branch.
SmallVector<llvm::Value *, 2> Metadata(1);
for (const auto *Attr : Attrs) {
const LoopHintAttr *LH = dyn_cast<LoopHintAttr>(Attr);
@@ -550,17 +550,17 @@ void CodeGenFunction::EmitCondBrHints(llvm::LLVMContext &Context,
switch (Option) {
case LoopHintAttr::Vectorize:
case LoopHintAttr::VectorizeWidth:
- MetadataName = "llvm.vectorizer.width";
+ MetadataName = "llvm.loop.vectorize.width";
break;
case LoopHintAttr::Interleave:
case LoopHintAttr::InterleaveCount:
- MetadataName = "llvm.vectorizer.unroll";
+ MetadataName = "llvm.loop.vectorize.unroll";
break;
case LoopHintAttr::Unroll:
- MetadataName = "llvm.loopunroll.enable";
+ MetadataName = "llvm.loop.unroll.enable";
break;
case LoopHintAttr::UnrollCount:
- MetadataName = "llvm.loopunroll.count";
+ MetadataName = "llvm.loop.unroll.count";
break;
}
@@ -572,7 +572,7 @@ void CodeGenFunction::EmitCondBrHints(llvm::LLVMContext &Context,
if (ValueInt == 1) {
// FIXME: In the future I will modifiy the behavior of the metadata
// so we can enable/disable vectorization and interleaving separately.
- Name = llvm::MDString::get(Context, "llvm.vectorizer.enable");
+ Name = llvm::MDString::get(Context, "llvm.loop.vectorize.enable");
Value = Builder.getTrue();
break;
}