LowerExpectIntrinsic.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #pragma once
  2. #ifdef __GNUC__
  3. #pragma GCC diagnostic push
  4. #pragma GCC diagnostic ignored "-Wunused-parameter"
  5. #endif
  6. //===- LowerExpectIntrinsic.h - LowerExpectIntrinsic pass -------*- C++ -*-===//
  7. //
  8. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  9. // See https://llvm.org/LICENSE.txt for license information.
  10. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  11. //
  12. //===----------------------------------------------------------------------===//
  13. /// \file
  14. ///
  15. /// The header file for the LowerExpectIntrinsic pass as used by the new pass
  16. /// manager.
  17. ///
  18. //===----------------------------------------------------------------------===//
  19. #ifndef LLVM_TRANSFORMS_SCALAR_LOWEREXPECTINTRINSIC_H
  20. #define LLVM_TRANSFORMS_SCALAR_LOWEREXPECTINTRINSIC_H
  21. #include "llvm/IR/Function.h"
  22. #include "llvm/IR/PassManager.h"
  23. namespace llvm {
  24. struct LowerExpectIntrinsicPass : PassInfoMixin<LowerExpectIntrinsicPass> {
  25. /// Run the pass over the function.
  26. ///
  27. /// This will lower all of the expect intrinsic calls in this function into
  28. /// branch weight metadata. That metadata will subsequently feed the analysis
  29. /// of the probabilities and frequencies of the CFG. After running this pass,
  30. /// no more expect intrinsics remain, allowing the rest of the optimizer to
  31. /// ignore them.
  32. PreservedAnalyses run(Function &F, FunctionAnalysisManager &);
  33. };
  34. }
  35. #endif
  36. #ifdef __GNUC__
  37. #pragma GCC diagnostic pop
  38. #endif