DeadStoreElimination.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #pragma once
  2. #ifdef __GNUC__
  3. #pragma GCC diagnostic push
  4. #pragma GCC diagnostic ignored "-Wunused-parameter"
  5. #endif
  6. //===- DeadStoreElimination.h - Fast Dead Store 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 implements a trivial dead store elimination that only considers
  15. // basic-block local redundant stores.
  16. //
  17. // FIXME: This should eventually be extended to be a post-dominator tree
  18. // traversal. Doing so would be pretty trivial.
  19. //
  20. //===----------------------------------------------------------------------===//
  21. #ifndef LLVM_TRANSFORMS_SCALAR_DEADSTOREELIMINATION_H
  22. #define LLVM_TRANSFORMS_SCALAR_DEADSTOREELIMINATION_H
  23. #include "llvm/IR/PassManager.h"
  24. namespace llvm {
  25. class Function;
  26. /// This class implements a trivial dead store elimination. We consider
  27. /// only the redundant stores that are local to a single Basic Block.
  28. class DSEPass : public PassInfoMixin<DSEPass> {
  29. public:
  30. PreservedAnalyses run(Function &F, FunctionAnalysisManager &FAM);
  31. };
  32. } // end namespace llvm
  33. #endif // LLVM_TRANSFORMS_SCALAR_DEADSTOREELIMINATION_H
  34. #ifdef __GNUC__
  35. #pragma GCC diagnostic pop
  36. #endif