Coverage Report

Created: 2017-04-27 19:33

/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 an when deemed required.
14
//===----------------------------------------------------------------------===///
15
16
#ifndef POLLY_POLYHEDRAL_INFO_H
17
#define POLLY_POLYHEDRAL_INFO_H
18
19
#include "llvm/Pass.h"
20
#include "isl/ctx.h"
21
#include "isl/union_map.h"
22
23
namespace llvm {
24
class Loop;
25
} // namespace llvm
26
27
namespace polly {
28
29
class Scop;
30
class ScopInfoWrapperPass;
31
class DependenceInfoWrapperPass;
32
33
class PolyhedralInfo : public llvm::FunctionPass {
34
public:
35
  static char ID; // Pass identification, replacement for typeid
36
37
  /// Construct a new PolyhedralInfo pass.
38
19
  PolyhedralInfo() : FunctionPass(ID) {}
39
19
  ~PolyhedralInfo() {}
40
41
  /// Check if a given loop is parallel.
42
  ///
43
  /// @param L The loop.
44
  ///
45
  /// @return  Returns true, if loop is parallel false otherwise.
46
  bool isParallel(llvm::Loop *L) const;
47
48
  /// Return the SCoP containing the @p L loop.
49
  ///
50
  /// @param L The loop.
51
  ///
52
  /// @return  Returns the SCoP containing the given loop.
53
  ///          Returns null if the loop is not contained in any SCoP.
54
  const Scop *getScopContainingLoop(llvm::Loop *L) const;
55
56
  /// Computes the partial schedule for the given @p L loop.
57
  ///
58
  /// @param S The SCoP containing the given loop
59
  /// @param L The loop.
60
  ///
61
  /// @return  Returns the partial schedule for the given loop
62
  __isl_give isl_union_map *getScheduleForLoop(const Scop *S,
63
                                               llvm::Loop *L) const;
64
65
  /// Get the SCoP and dependence analysis information for @p F.
66
  bool runOnFunction(llvm::Function &F) override;
67
68
  /// Release the internal memory.
69
19
  void releaseMemory() override {}
70
71
  /// Print to @p OS if each dimension of a loop nest is parallel or not.
72
  void print(llvm::raw_ostream &OS,
73
             const llvm::Module *M = nullptr) const override;
74
75
  /// Register all analyses and transformation required.
76
  void getAnalysisUsage(llvm::AnalysisUsage &AU) const override;
77
78
private:
79
  /// Check if a given loop is parallel or vectorizable.
80
  ///
81
  /// @param L             The loop.
82
  /// @param MinDepDistPtr If not nullptr, the minimal dependence distance will
83
  ///                      be returned at the address of that pointer
84
  ///
85
  /// @return  Returns true if loop is parallel or vectorizable, false
86
  ///          otherwise.
87
  bool checkParallel(llvm::Loop *L,
88
                     __isl_give isl_pw_aff **MinDepDistPtr = nullptr) const;
89
90
  ScopInfoWrapperPass *SI;
91
  DependenceInfoWrapperPass *DI;
92
};
93
94
} // end namespace polly
95
96
namespace llvm {
97
class PassRegistry;
98
void initializePolyhedralInfoPass(llvm::PassRegistry &);
99
} // namespace llvm
100
101
#endif