17330f729Sjoerg //===- CSEConfigBase.h - A CSEConfig interface ------------------*- C++ -*-===// 27330f729Sjoerg // 37330f729Sjoerg // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 47330f729Sjoerg // See https://llvm.org/LICENSE.txt for license information. 57330f729Sjoerg // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 67330f729Sjoerg // 77330f729Sjoerg //===----------------------------------------------------------------------===// 87330f729Sjoerg 9*82d56013Sjoerg #ifndef LLVM_CODEGEN_CSECONFIGBASE_H 10*82d56013Sjoerg #define LLVM_CODEGEN_CSECONFIGBASE_H 117330f729Sjoerg 127330f729Sjoerg namespace llvm { 137330f729Sjoerg // Class representing some configuration that can be done during GlobalISel's 147330f729Sjoerg // CSEInfo analysis. We define it here because TargetPassConfig can't depend on 157330f729Sjoerg // the GlobalISel library, and so we use this in the interface between them 167330f729Sjoerg // so that the derived classes in GISel can reference generic opcodes. 177330f729Sjoerg class CSEConfigBase { 187330f729Sjoerg public: 197330f729Sjoerg virtual ~CSEConfigBase() = default; 207330f729Sjoerg // Hook for defining which Generic instructions should be CSEd. 217330f729Sjoerg // GISelCSEInfo currently only calls this hook when dealing with generic 227330f729Sjoerg // opcodes. shouldCSEOpc(unsigned Opc)237330f729Sjoerg virtual bool shouldCSEOpc(unsigned Opc) { return false; } 247330f729Sjoerg }; 257330f729Sjoerg 267330f729Sjoerg } // namespace llvm 277330f729Sjoerg 28*82d56013Sjoerg #endif // LLVM_CODEGEN_CSECONFIGBASE_H 29