CSEConfigBase.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. #pragma once
  2. #ifdef __GNUC__
  3. #pragma GCC diagnostic push
  4. #pragma GCC diagnostic ignored "-Wunused-parameter"
  5. #endif
  6. //===- CSEConfigBase.h - A CSEConfig interface ------------------*- 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. #ifndef LLVM_CODEGEN_CSECONFIGBASE_H
  14. #define LLVM_CODEGEN_CSECONFIGBASE_H
  15. namespace llvm {
  16. // Class representing some configuration that can be done during GlobalISel's
  17. // CSEInfo analysis. We define it here because TargetPassConfig can't depend on
  18. // the GlobalISel library, and so we use this in the interface between them
  19. // so that the derived classes in GISel can reference generic opcodes.
  20. class CSEConfigBase {
  21. public:
  22. virtual ~CSEConfigBase() = default;
  23. // Hook for defining which Generic instructions should be CSEd.
  24. // GISelCSEInfo currently only calls this hook when dealing with generic
  25. // opcodes.
  26. virtual bool shouldCSEOpc(unsigned Opc) { return false; }
  27. };
  28. } // namespace llvm
  29. #endif // LLVM_CODEGEN_CSECONFIGBASE_H
  30. #ifdef __GNUC__
  31. #pragma GCC diagnostic pop
  32. #endif