1 //===- LowerExpectIntrinsic.h - LowerExpectIntrinsic pass -------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
11 /// The header file for the LowerExpectIntrinsic pass as used by the new pass
14 //===----------------------------------------------------------------------===//
16 #ifndef LLVM_TRANSFORMS_SCALAR_LOWEREXPECTINTRINSIC_H
17 #define LLVM_TRANSFORMS_SCALAR_LOWEREXPECTINTRINSIC_H
19 #include "llvm/IR/Function.h"
20 #include "llvm/IR/PassManager.h"
24 class LowerExpectIntrinsicPass {
26 static StringRef name() { return "LowerExpectIntrinsicPass"; }
28 /// \brief Run the pass over the function.
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
35 PreservedAnalyses run(Function &F);