CSEConfigBase.h 1.1 KB

12345678910111213141516171819202122232425262728
  1. //===- CSEConfigBase.h - A CSEConfig interface ------------------*- C++ -*-===//
  2. //
  3. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  4. // See https://llvm.org/LICENSE.txt for license information.
  5. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  6. //
  7. //===----------------------------------------------------------------------===//
  8. #ifndef LLVM_CODEGEN_CSECONFIGBASE_H
  9. #define LLVM_CODEGEN_CSECONFIGBASE_H
  10. namespace llvm {
  11. // Class representing some configuration that can be done during GlobalISel's
  12. // CSEInfo analysis. We define it here because TargetPassConfig can't depend on
  13. // the GlobalISel library, and so we use this in the interface between them
  14. // so that the derived classes in GISel can reference generic opcodes.
  15. class CSEConfigBase {
  16. public:
  17. virtual ~CSEConfigBase() = default;
  18. // Hook for defining which Generic instructions should be CSEd.
  19. // GISelCSEInfo currently only calls this hook when dealing with generic
  20. // opcodes.
  21. virtual bool shouldCSEOpc(unsigned Opc) { return false; }
  22. };
  23. } // namespace llvm
  24. #endif // LLVM_CODEGEN_CSECONFIGBASE_H