• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //===- LowerExpectIntrinsic.h - LowerExpectIntrinsic pass -------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 /// \file
10 ///
11 /// The header file for the LowerExpectIntrinsic pass as used by the new pass
12 /// manager.
13 ///
14 //===----------------------------------------------------------------------===//
15 
16 #ifndef LLVM_TRANSFORMS_SCALAR_LOWEREXPECTINTRINSIC_H
17 #define LLVM_TRANSFORMS_SCALAR_LOWEREXPECTINTRINSIC_H
18 
19 #include "llvm/IR/Function.h"
20 #include "llvm/IR/PassManager.h"
21 
22 namespace llvm {
23 
24 class LowerExpectIntrinsicPass {
25 public:
name()26   static StringRef name() { return "LowerExpectIntrinsicPass"; }
27 
28   /// \brief Run the pass over the function.
29   ///
30   /// This will lower all of th expect intrinsic calls in this function into
31   /// branch weight metadata. That metadata will subsequently feed the analysis
32   /// of the probabilities and frequencies of the CFG. After running this pass,
33   /// no more expect intrinsics remain, allowing the rest of the optimizer to
34   /// ignore them.
35   PreservedAnalyses run(Function &F);
36 };
37 
38 }
39 
40 #endif
41