summaryrefslogtreecommitdiff
path: root/lib/Transforms
diff options
context:
space:
mode:
authorEli Bendersky <eliben@google.com>2014-06-25 15:41:00 +0000
committerEli Bendersky <eliben@google.com>2014-06-25 15:41:00 +0000
commitbb167336b33024022c78cbc1d679758282c5b608 (patch)
tree32c8686f243c717441f4e62277c7eb225b987236 /lib/Transforms
parenta9d13b157f39979b8e2d4e53684c5ebe20a3f152 (diff)
downloadllvm-bb167336b33024022c78cbc1d679758282c5b608.tar.gz
llvm-bb167336b33024022c78cbc1d679758282c5b608.tar.bz2
llvm-bb167336b33024022c78cbc1d679758282c5b608.tar.xz
Rename loop unrolling and loop vectorizer metadata to have a common prefix.
[LLVM 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/llvm/trunk@211710 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
-rw-r--r--lib/Transforms/Scalar/LoopUnrollPass.cpp10
-rw-r--r--lib/Transforms/Vectorize/LoopVectorize.cpp3
2 files changed, 5 insertions, 8 deletions
diff --git a/lib/Transforms/Scalar/LoopUnrollPass.cpp b/lib/Transforms/Scalar/LoopUnrollPass.cpp
index 0af5a71c12..00c0f88a64 100644
--- a/lib/Transforms/Scalar/LoopUnrollPass.cpp
+++ b/lib/Transforms/Scalar/LoopUnrollPass.cpp
@@ -220,7 +220,7 @@ static unsigned ApproximateLoopSize(const Loop *L, unsigned &NumCalls,
}
// Returns the value associated with the given metadata node name (for
-// example, "llvm.loopunroll.count"). If no such named metadata node
+// example, "llvm.loop.unroll.count"). If no such named metadata node
// exists, then nullptr is returned.
static const ConstantInt *GetUnrollMetadataValue(const Loop *L,
StringRef Name) {
@@ -250,24 +250,22 @@ static const ConstantInt *GetUnrollMetadataValue(const Loop *L,
// Returns true if the loop has an unroll(enable) pragma.
static bool HasUnrollEnablePragma(const Loop *L) {
const ConstantInt *EnableValue =
- GetUnrollMetadataValue(L, "llvm.loopunroll.enable");
+ GetUnrollMetadataValue(L, "llvm.loop.unroll.enable");
return (EnableValue && EnableValue->getZExtValue());
- return false;
}
// Returns true if the loop has an unroll(disable) pragma.
static bool HasUnrollDisablePragma(const Loop *L) {
const ConstantInt *EnableValue =
- GetUnrollMetadataValue(L, "llvm.loopunroll.enable");
+ GetUnrollMetadataValue(L, "llvm.loop.unroll.enable");
return (EnableValue && !EnableValue->getZExtValue());
- return false;
}
// If loop has an unroll_count pragma return the (necessarily
// positive) value from the pragma. Otherwise return 0.
static unsigned UnrollCountPragmaValue(const Loop *L) {
const ConstantInt *CountValue =
- GetUnrollMetadataValue(L, "llvm.loopunroll.count");
+ GetUnrollMetadataValue(L, "llvm.loop.unroll.count");
if (CountValue) {
unsigned Count = CountValue->getZExtValue();
assert(Count >= 1 && "Unroll count must be positive.");
diff --git a/lib/Transforms/Vectorize/LoopVectorize.cpp b/lib/Transforms/Vectorize/LoopVectorize.cpp
index 79a6ecd15b..27452825c7 100644
--- a/lib/Transforms/Vectorize/LoopVectorize.cpp
+++ b/lib/Transforms/Vectorize/LoopVectorize.cpp
@@ -906,7 +906,7 @@ public:
}
/// Return the loop vectorizer metadata prefix.
- static StringRef Prefix() { return "llvm.vectorizer."; }
+ static StringRef Prefix() { return "llvm.loop.vectorize."; }
MDNode *createHint(LLVMContext &Context, StringRef Name, unsigned V) const {
SmallVector<Value*, 2> Vals;
@@ -5859,4 +5859,3 @@ Value *InnerLoopUnroller::getConsecutiveVector(Value* Val, int StartIdx,
Constant *C = ConstantInt::get(ITy, StartIdx, Negate);
return Builder.CreateAdd(Val, C, "induction");
}
-