summaryrefslogtreecommitdiff
path: root/include/llvm/Analysis/LoopInfo.h
diff options
context:
space:
mode:
authorPaul Redmond <paul.redmond@intel.com>2013-05-28 20:00:34 +0000
committerPaul Redmond <paul.redmond@intel.com>2013-05-28 20:00:34 +0000
commitee21b6f7b41e3fc19031f6d410b2ebe6a1a2f361 (patch)
tree2aa58825f8b66f5b1aae72312b9cdaf5f9da8a69 /include/llvm/Analysis/LoopInfo.h
parenta32edcfbc5b99b808b67360311d513af650eab44 (diff)
downloadllvm-ee21b6f7b41e3fc19031f6d410b2ebe6a1a2f361.tar.gz
llvm-ee21b6f7b41e3fc19031f6d410b2ebe6a1a2f361.tar.bz2
llvm-ee21b6f7b41e3fc19031f6d410b2ebe6a1a2f361.tar.xz
Add support for llvm.vectorizer metadata
- llvm.loop.parallel metadata has been renamed to llvm.loop to be more generic by making the root of additional loop metadata. - Loop::isAnnotatedParallel now looks for llvm.loop and associated llvm.mem.parallel_loop_access - document llvm.loop and update llvm.mem.parallel_loop_access - add support for llvm.vectorizer.width and llvm.vectorizer.unroll - document llvm.vectorizer.* metadata - add utility class LoopVectorizerHints for getting/setting loop metadata - use llvm.vectorizer.width=1 to indicate already vectorized instead of already_vectorized - update existing tests that used llvm.loop.parallel and llvm.vectorizer.already_vectorized Reviewed by: Nadav Rotem git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182802 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Analysis/LoopInfo.h')
-rw-r--r--include/llvm/Analysis/LoopInfo.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/include/llvm/Analysis/LoopInfo.h b/include/llvm/Analysis/LoopInfo.h
index 783e347522..7b3eed7350 100644
--- a/include/llvm/Analysis/LoopInfo.h
+++ b/include/llvm/Analysis/LoopInfo.h
@@ -50,6 +50,7 @@ inline void RemoveFromVector(std::vector<T*> &V, T *N) {
class DominatorTree;
class LoopInfo;
class Loop;
+class MDNode;
class PHINode;
class raw_ostream;
template<class N, class M> class LoopInfoBase;
@@ -391,6 +392,22 @@ public:
/// iterations.
bool isAnnotatedParallel() const;
+ /// Return the llvm.loop loop id metadata node for this loop if it is present.
+ ///
+ /// If this loop contains the same llvm.loop metadata on each branch to the
+ /// header then the node is returned. If any latch instruction does not
+ /// contain llvm.loop or or if multiple latches contain different nodes then
+ /// 0 is returned.
+ MDNode *getLoopID() const;
+ /// Set the llvm.loop loop id metadata for this loop.
+ ///
+ /// The LoopID metadata node will be added to each terminator instruction in
+ /// the loop that branches to the loop header.
+ ///
+ /// The LoopID metadata node should have one or more operands and the first
+ /// operand should should be the node itself.
+ void setLoopID(MDNode *LoopID) const;
+
/// hasDedicatedExits - Return true if no exit block for the loop
/// has a predecessor that is outside the loop.
bool hasDedicatedExits() const;