SCCP.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #pragma once
  2. #ifdef __GNUC__
  3. #pragma GCC diagnostic push
  4. #pragma GCC diagnostic ignored "-Wunused-parameter"
  5. #endif
  6. //===- SCCP.cpp - Sparse Conditional Constant Propagation -------*- 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. //
  14. // \file
  15. // This file implements sparse conditional constant propagation and merging:
  16. //
  17. // Specifically, this:
  18. // * Assumes values are constant unless proven otherwise
  19. // * Assumes BasicBlocks are dead unless proven otherwise
  20. // * Proves values to be constant, and replaces them with constants
  21. // * Proves conditional branches to be unconditional
  22. //
  23. //===----------------------------------------------------------------------===//
  24. #ifndef LLVM_TRANSFORMS_SCALAR_SCCP_H
  25. #define LLVM_TRANSFORMS_SCALAR_SCCP_H
  26. #include "llvm/ADT/STLFunctionalExtras.h"
  27. #include "llvm/IR/PassManager.h"
  28. #include <functional>
  29. namespace llvm {
  30. class AssumptionCache;
  31. class DataLayout;
  32. class Function;
  33. class Module;
  34. class TargetLibraryInfo;
  35. class TargetTransformInfo;
  36. struct AnalysisResultsForFn;
  37. /// This pass performs function-level constant propagation and merging.
  38. class SCCPPass : public PassInfoMixin<SCCPPass> {
  39. public:
  40. PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
  41. };
  42. } // end namespace llvm
  43. #endif // LLVM_TRANSFORMS_SCALAR_SCCP_H
  44. #ifdef __GNUC__
  45. #pragma GCC diagnostic pop
  46. #endif