Coverage Report

Created: 2019-02-21 13:17

/Users/buildslave/jenkins/workspace/clang-stage2-coverage-R/llvm/tools/polly/include/polly/PolyhedralInfo.h
Line
Count
Source
1
//===- polly/PolyhedralInfo.h - PolyhedralInfo class definition -*- C++ -*-===//
2
//
3
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
// See https://llvm.org/LICENSE.txt for license information.
5
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
//
7
//===----------------------------------------------------------------------===//
8
///
9
/// This file contains the declaration of the PolyhedralInfo class, which will
10
/// provide an interface to expose polyhedral analysis information of Polly.
11
///
12
/// This is work in progress. We will add more API's as and when deemed
13
/// 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 ScopInfo;
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
  ScopInfo *SI;
91
  DependenceInfoWrapperPass *DI;
92
};
93
} // end namespace polly
94
95
namespace llvm {
96
class PassRegistry;
97
void initializePolyhedralInfoPass(llvm::PassRegistry &);
98
} // namespace llvm
99
100
#endif