ADCE.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #pragma once
  2. #ifdef __GNUC__
  3. #pragma GCC diagnostic push
  4. #pragma GCC diagnostic ignored "-Wunused-parameter"
  5. #endif
  6. //===- ADCE.h - Aggressive dead code elimination ----------------*- 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. // This file provides the interface for the Aggressive Dead Code Elimination
  15. // pass. This pass optimistically assumes that all instructions are dead until
  16. // proven otherwise, allowing it to eliminate dead computations that other DCE
  17. // passes do not catch, particularly involving loop computations.
  18. //
  19. //===----------------------------------------------------------------------===//
  20. #ifndef LLVM_TRANSFORMS_SCALAR_ADCE_H
  21. #define LLVM_TRANSFORMS_SCALAR_ADCE_H
  22. #include "llvm/IR/PassManager.h"
  23. namespace llvm {
  24. class Function;
  25. /// A DCE pass that assumes instructions are dead until proven otherwise.
  26. ///
  27. /// This pass eliminates dead code by optimistically assuming that all
  28. /// instructions are dead until proven otherwise. This allows it to eliminate
  29. /// dead computations that other DCE passes do not catch, particularly involving
  30. /// loop computations.
  31. struct ADCEPass : PassInfoMixin<ADCEPass> {
  32. PreservedAnalyses run(Function &F, FunctionAnalysisManager &);
  33. };
  34. } // end namespace llvm
  35. #endif // LLVM_TRANSFORMS_SCALAR_ADCE_H
  36. #ifdef __GNUC__
  37. #pragma GCC diagnostic pop
  38. #endif