blob: 7d2b26252172392e3de4af9bc680433de7f3560d [file] [log] [blame]
Diego Caballero168d04d2018-05-21 18:14:23 +00001//===-- VPlanVerifier.h -----------------------------------------*- C++ -*-===//
2//
Chandler Carruth2946cd72019-01-19 08:50:56 +00003// 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
Diego Caballero168d04d2018-05-21 18:14:23 +00006//
7//===----------------------------------------------------------------------===//
8///
9/// \file
10/// This file declares the class VPlanVerifier, which contains utility functions
11/// to check the consistency of a VPlan. This includes the following kinds of
12/// invariants:
13///
14/// 1. Region/Block invariants:
15/// - Region's entry/exit block must have no predecessors/successors,
16/// respectively.
17/// - Block's parent must be the region immediately containing the block.
18/// - Linked blocks must have a bi-directional link (successor/predecessor).
19/// - All predecessors/successors of a block must belong to the same region.
20/// - Blocks must have no duplicated successor/predecessor.
21///
22//===----------------------------------------------------------------------===//
23
24#ifndef LLVM_TRANSFORMS_VECTORIZE_VPLANVERIFIER_H
25#define LLVM_TRANSFORMS_VECTORIZE_VPLANVERIFIER_H
26
27#include "VPlan.h"
28
29namespace llvm {
30
31/// Class with utility functions that can be used to check the consistency and
32/// invariants of a VPlan, including the components of its H-CFG.
33class VPlanVerifier {
34public:
35 /// Verify the invariants of the H-CFG starting from \p TopRegion. The
36 /// verification process comprises the following steps:
37 /// 1. Region/Block verification: Check the Region/Block verification
38 /// invariants for every region in the H-CFG.
39 void verifyHierarchicalCFG(const VPRegionBlock *TopRegion) const;
40};
41} // namespace llvm
42
43#endif //LLVM_TRANSFORMS_VECTORIZE_VPLANVERIFIER_H