LowerExpectIntrinsic.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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. #ifndef LLVM_TRANSFORMS_SCALAR_LOWEREXPECTINTRINSIC_H
  16. #define LLVM_TRANSFORMS_SCALAR_LOWEREXPECTINTRINSIC_H
  17. #include "llvm/IR/Function.h"
  18. #include "llvm/IR/PassManager.h"
  19. namespace llvm {
  20. class LowerExpectIntrinsicPass {
  21. public:
  22. static StringRef name() { return "LowerExpectIntrinsicPass"; }
  23. /// \brief Run the pass over the function.
  24. ///
  25. /// This will lower all of th expect intrinsic calls in this function into
  26. /// branch weight metadata. That metadata will subsequently feed the analysis
  27. /// of the probabilities and frequencies of the CFG. After running this pass,
  28. /// no more expect intrinsics remain, allowing the rest of the optimizer to
  29. /// ignore them.
  30. PreservedAnalyses run(Function &F);
  31. };
  32. }
  33. #endif