LowerConstantIntrinsics.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #pragma once
  2. #ifdef __GNUC__
  3. #pragma GCC diagnostic push
  4. #pragma GCC diagnostic ignored "-Wunused-parameter"
  5. #endif
  6. //===- LowerConstantIntrinsics.h - Lower constant int. 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 LowerConstantIntrinsics pass as used by the new pass
  16. /// manager.
  17. ///
  18. //===----------------------------------------------------------------------===//
  19. #ifndef LLVM_TRANSFORMS_SCALAR_LOWERCONSTANTINTRINSICS_H
  20. #define LLVM_TRANSFORMS_SCALAR_LOWERCONSTANTINTRINSICS_H
  21. #include "llvm/IR/PassManager.h"
  22. namespace llvm {
  23. class Function;
  24. struct LowerConstantIntrinsicsPass :
  25. PassInfoMixin<LowerConstantIntrinsicsPass> {
  26. public:
  27. explicit LowerConstantIntrinsicsPass() = default;
  28. /// Run the pass over the function.
  29. ///
  30. /// This will lower all remaining 'objectsize' and 'is.constant'`
  31. /// intrinsic calls in this function, even when the argument has no known
  32. /// size or is not a constant respectively. The resulting constant is
  33. /// propagated and conditional branches are resolved where possible.
  34. /// This complements the Instruction Simplification and
  35. /// Instruction Combination passes of the optimized pass chain.
  36. PreservedAnalyses run(Function &F, FunctionAnalysisManager &);
  37. };
  38. }
  39. #endif
  40. #ifdef __GNUC__
  41. #pragma GCC diagnostic pop
  42. #endif