InstCombine.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. //===- InstCombine.h - InstCombine 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. /// This file provides the primary interface to the instcombine pass. This pass
  12. /// is suitable for use in the new pass manager. For a pass that works with the
  13. /// legacy pass manager, please look for \c createInstructionCombiningPass() in
  14. /// Scalar.h.
  15. ///
  16. //===----------------------------------------------------------------------===//
  17. #ifndef LLVM_TRANSFORMS_INSTCOMBINE_INSTCOMBINE_H
  18. #define LLVM_TRANSFORMS_INSTCOMBINE_INSTCOMBINE_H
  19. #include "llvm/IR/Function.h"
  20. #include "llvm/IR/PassManager.h"
  21. #include "llvm/Transforms/InstCombine/InstCombineWorklist.h"
  22. namespace llvm {
  23. class InstCombinePass {
  24. InstCombineWorklist Worklist;
  25. public:
  26. static StringRef name() { return "InstCombinePass"; }
  27. // Explicitly define constructors for MSVC.
  28. InstCombinePass() {}
  29. InstCombinePass(InstCombinePass &&Arg) : Worklist(std::move(Arg.Worklist)) {}
  30. InstCombinePass &operator=(InstCombinePass &&RHS) {
  31. Worklist = std::move(RHS.Worklist);
  32. return *this;
  33. }
  34. PreservedAnalyses run(Function &F, AnalysisManager<Function> *AM);
  35. };
  36. }
  37. #endif