[Alignment][NFC] Support compile time constants
[llvm-core.git] / include / llvm / Transforms / Utils / GuardUtils.h
blob3b365c56a5c01be4b9a6f64ed46a0a9d218950b5
1 //===-- GuardUtils.h - Utils for work with guards ---------------*- 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 // Utils that are used to perform transformations related to guards and their
9 // conditions.
10 //===----------------------------------------------------------------------===//
12 #ifndef LLVM_TRANSFORMS_UTILS_GUARDUTILS_H
13 #define LLVM_TRANSFORMS_UTILS_GUARDUTILS_H
15 namespace llvm {
17 class CallInst;
18 class Function;
20 /// Splits control flow at point of \p Guard, replacing it with explicit branch
21 /// by the condition of guard's first argument. The taken branch then goes to
22 /// the block that contains \p Guard's successors, and the non-taken branch
23 /// goes to a newly-created deopt block that contains a sole call of the
24 /// deoptimize function \p DeoptIntrinsic.
25 void makeGuardControlFlowExplicit(Function *DeoptIntrinsic, CallInst *Guard);
27 } // llvm
29 #endif // LLVM_TRANSFORMS_UTILS_GUARDUTILS_H