]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/include/llvm/Transforms/Scalar/LowerExpectIntrinsic.h
Merge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp
[FreeBSD/FreeBSD.git] / contrib / llvm / include / llvm / Transforms / Scalar / LowerExpectIntrinsic.h
1 //===- LowerExpectIntrinsic.h - LowerExpectIntrinsic pass -------*- 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 /// \file
9 ///
10 /// The header file for the LowerExpectIntrinsic pass as used by the new pass
11 /// manager.
12 ///
13 //===----------------------------------------------------------------------===//
14
15 #ifndef LLVM_TRANSFORMS_SCALAR_LOWEREXPECTINTRINSIC_H
16 #define LLVM_TRANSFORMS_SCALAR_LOWEREXPECTINTRINSIC_H
17
18 #include "llvm/IR/Function.h"
19 #include "llvm/IR/PassManager.h"
20
21 namespace llvm {
22
23 struct LowerExpectIntrinsicPass : PassInfoMixin<LowerExpectIntrinsicPass> {
24   /// Run the pass over the function.
25   ///
26   /// This will lower all of the expect intrinsic calls in this function into
27   /// branch weight metadata. That metadata will subsequently feed the analysis
28   /// of the probabilities and frequencies of the CFG. After running this pass,
29   /// no more expect intrinsics remain, allowing the rest of the optimizer to
30   /// ignore them.
31   PreservedAnalyses run(Function &F, FunctionAnalysisManager &);
32 };
33
34 }
35
36 #endif