1 //===-- GuardUtils.h - Utils for work with guards ---------------*- C++ -*-===//
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
7 //===----------------------------------------------------------------------===//
8 // Utils that are used to perform transformations related to guards and their
10 //===----------------------------------------------------------------------===//
12 #ifndef LLVM_TRANSFORMS_UTILS_GUARDUTILS_H
13 #define LLVM_TRANSFORMS_UTILS_GUARDUTILS_H
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
);
29 #endif // LLVM_TRANSFORMS_UTILS_GUARDUTILS_H