Coverage Report

Created: 2017-06-28 17:40

/Users/buildslave/jenkins/sharedspace/clang-stage2-coverage-R@2/llvm/tools/polly/include/polly/PolyhedralInfo.h
Line
Count
Source
1
//===- polly/PolyhedralInfo.h - PolyhedralInfo class definition -*- C++ -*-===//
2
//
3
//                     The LLVM Compiler Infrastructure
4
//
5
// This file is distributed under the University of Illinois Open Source
6
// License. See LICENSE.TXT for details.
7
//
8
//===----------------------------------------------------------------------===//
9
///
10
/// This file contains the declaration of the PolyhedralInfo class, which will
11
/// provide an interface to expose polyhedral analysis information of Polly.
12
///
13
/// This is work in progress. We will add more API's as and when deemed
14
/// required.
15
//===----------------------------------------------------------------------===///
16
17
#ifndef POLLY_POLYHEDRAL_INFO_H
18
#define POLLY_POLYHEDRAL_INFO_H
19
20
#include "llvm/Pass.h"
21
#include "isl/ctx.h"
22
#include "isl/union_map.h"
23
24
namespace llvm {
25
class Loop;
26
} // namespace llvm
27
28
namespace polly {
29
30
class Scop;
31
class ScopInfo;
32
class DependenceInfoWrapperPass;
33
34
class PolyhedralInfo : public llvm::FunctionPass {
35
public:
36
  static char ID; // Pass identification, replacement for typeid
37
38
  /// Construct a new PolyhedralInfo pass.
39
19
  PolyhedralInfo() : FunctionPass(ID) {}
40
19
  ~PolyhedralInfo() {}
41
42
  /// Check if a given loop is parallel.
43
  ///
44
  /// @param L The loop.
45
  ///
46
  /// @return  Returns true, if loop is parallel false otherwise.
47
  bool isParallel(llvm::Loop *L) const;
48
49
  /// Return the SCoP containing the @p L loop.
50
  ///
51
  /// @param L The loop.
52
  ///
53
  /// @return  Returns the SCoP containing the given loop.
54
  ///          Returns null if the loop is not contained in any SCoP.
55
  const Scop *getScopContainingLoop(llvm::Loop *L) const;
56
57
  /// Computes the partial schedule for the given @p L loop.
58
  ///
59
  /// @param S The SCoP containing the given loop
60
  /// @param L The loop.
61
  ///
62
  /// @return  Returns the partial schedule for the given loop
63
  __isl_give isl_union_map *getScheduleForLoop(const Scop *S,
64
                                               llvm::Loop *L) const;
65
66
  /// Get the SCoP and dependence analysis information for @p F.
67
  bool runOnFunction(llvm::Function &F) override;
68
69
  /// Release the internal memory.
70
19
  void releaseMemory() override {}
71
72
  /// Print to @p OS if each dimension of a loop nest is parallel or not.
73
  void print(llvm::raw_ostream &OS,
74
             const llvm::Module *M = nullptr) const override;
75
76
  /// Register all analyses and transformation required.
77
  void getAnalysisUsage(llvm::AnalysisUsage &AU) const override;
78
79
private:
80
  /// Check if a given loop is parallel or vectorizable.
81
  ///
82
  /// @param L             The loop.
83
  /// @param MinDepDistPtr If not nullptr, the minimal dependence distance will
84
  ///                      be returned at the address of that pointer
85
  ///
86
  /// @return  Returns true if loop is parallel or vectorizable, false
87
  ///          otherwise.
88
  bool checkParallel(llvm::Loop *L,
89
                     __isl_give isl_pw_aff **MinDepDistPtr = nullptr) const;
90
91
  ScopInfo *SI;
92
  DependenceInfoWrapperPass *DI;
93
};
94
95
} // end namespace polly
96
97
namespace llvm {
98
class PassRegistry;
99
void initializePolyhedralInfoPass(llvm::PassRegistry &);
100
} // namespace llvm
101
102
#endif