xref: /freebsd/contrib/llvm-project/llvm/lib/Transforms/Vectorize/VPlanVerifier.h (revision 0fca6ea1d4eea4c934cfff25ac9ee8ad6fe95583)
10b57cec5SDimitry Andric //===-- VPlanVerifier.h -----------------------------------------*- C++ -*-===//
20b57cec5SDimitry Andric //
30b57cec5SDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
40b57cec5SDimitry Andric // See https://llvm.org/LICENSE.txt for license information.
50b57cec5SDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
60b57cec5SDimitry Andric //
70b57cec5SDimitry Andric //===----------------------------------------------------------------------===//
80b57cec5SDimitry Andric ///
90b57cec5SDimitry Andric /// \file
100b57cec5SDimitry Andric /// This file declares the class VPlanVerifier, which contains utility functions
110b57cec5SDimitry Andric /// to check the consistency of a VPlan. This includes the following kinds of
120b57cec5SDimitry Andric /// invariants:
130b57cec5SDimitry Andric ///
140b57cec5SDimitry Andric /// 1. Region/Block invariants:
150b57cec5SDimitry Andric ///   - Region's entry/exit block must have no predecessors/successors,
160b57cec5SDimitry Andric ///     respectively.
170b57cec5SDimitry Andric ///   - Block's parent must be the region immediately containing the block.
180b57cec5SDimitry Andric ///   - Linked blocks must have a bi-directional link (successor/predecessor).
190b57cec5SDimitry Andric ///   - All predecessors/successors of a block must belong to the same region.
200b57cec5SDimitry Andric ///   - Blocks must have no duplicated successor/predecessor.
210b57cec5SDimitry Andric ///
220b57cec5SDimitry Andric //===----------------------------------------------------------------------===//
230b57cec5SDimitry Andric 
240b57cec5SDimitry Andric #ifndef LLVM_TRANSFORMS_VECTORIZE_VPLANVERIFIER_H
250b57cec5SDimitry Andric #define LLVM_TRANSFORMS_VECTORIZE_VPLANVERIFIER_H
260b57cec5SDimitry Andric 
270b57cec5SDimitry Andric namespace llvm {
28349cc55cSDimitry Andric class VPlan;
290b57cec5SDimitry Andric 
30*0fca6ea1SDimitry Andric /// Verify invariants for general VPlans. Currently it checks the following:
310b57cec5SDimitry Andric /// 1. Region/Block verification: Check the Region/Block verification
320b57cec5SDimitry Andric /// invariants for every region in the H-CFG.
33*0fca6ea1SDimitry Andric /// 2. all phi-like recipes must be at the beginning of a block, with no other
34349cc55cSDimitry Andric /// recipes in between. Note that currently there is still an exception for
35349cc55cSDimitry Andric /// VPBlendRecipes.
36*0fca6ea1SDimitry Andric bool verifyVPlanIsValid(const VPlan &Plan);
37*0fca6ea1SDimitry Andric 
380b57cec5SDimitry Andric } // namespace llvm
390b57cec5SDimitry Andric 
400b57cec5SDimitry Andric #endif //LLVM_TRANSFORMS_VECTORIZE_VPLANVERIFIER_H
41