InstSimplifyPass.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #pragma once
  2. #ifdef __GNUC__
  3. #pragma GCC diagnostic push
  4. #pragma GCC diagnostic ignored "-Wunused-parameter"
  5. #endif
  6. //===- InstSimplifyPass.h ---------------------------------------*- 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. /// Defines passes for running instruction simplification across chunks of IR.
  16. ///
  17. //===----------------------------------------------------------------------===//
  18. #ifndef LLVM_TRANSFORMS_SCALAR_INSTSIMPLIFYPASS_H
  19. #define LLVM_TRANSFORMS_SCALAR_INSTSIMPLIFYPASS_H
  20. #include "llvm/IR/PassManager.h"
  21. namespace llvm {
  22. /// Run instruction simplification across each instruction in the function.
  23. ///
  24. /// Instruction simplification has useful constraints in some contexts:
  25. /// - It will never introduce *new* instructions.
  26. /// - There is no need to iterate to a fixed point.
  27. ///
  28. /// Many passes use instruction simplification as a library facility, but it may
  29. /// also be useful (in tests and other contexts) to have access to this very
  30. /// restricted transform at a pass granularity. However, for a much more
  31. /// powerful and comprehensive peephole optimization engine, see the
  32. /// `instcombine` pass instead.
  33. class InstSimplifyPass : public PassInfoMixin<InstSimplifyPass> {
  34. public:
  35. PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
  36. };
  37. } // end namespace llvm
  38. #endif // LLVM_TRANSFORMS_SCALAR_INSTSIMPLIFYPASS_H
  39. #ifdef __GNUC__
  40. #pragma GCC diagnostic pop
  41. #endif