104eeddc0SDimitry Andric //===-------------------- X86CustomBehaviour.h ------------------*-C++ -* -===// 204eeddc0SDimitry Andric // 304eeddc0SDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 404eeddc0SDimitry Andric // See https://llvm.org/LICENSE.txt for license information. 504eeddc0SDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 604eeddc0SDimitry Andric // 704eeddc0SDimitry Andric //===----------------------------------------------------------------------===// 804eeddc0SDimitry Andric /// \file 904eeddc0SDimitry Andric /// 1004eeddc0SDimitry Andric /// This file defines the X86CustomBehaviour class which inherits from 1104eeddc0SDimitry Andric /// CustomBehaviour. This class is used by the tool llvm-mca to enforce 1204eeddc0SDimitry Andric /// target specific behaviour that is not expressed well enough in the 1304eeddc0SDimitry Andric /// scheduling model for mca to enforce it automatically. 1404eeddc0SDimitry Andric /// 1504eeddc0SDimitry Andric //===----------------------------------------------------------------------===// 1604eeddc0SDimitry Andric 1704eeddc0SDimitry Andric #ifndef LLVM_LIB_TARGET_X86_MCA_X86CUSTOMBEHAVIOUR_H 1804eeddc0SDimitry Andric #define LLVM_LIB_TARGET_X86_MCA_X86CUSTOMBEHAVIOUR_H 1904eeddc0SDimitry Andric 2004eeddc0SDimitry Andric #include "llvm/MCA/CustomBehaviour.h" 21*06c3fb27SDimitry Andric #include "llvm/TargetParser/TargetParser.h" 2204eeddc0SDimitry Andric 2304eeddc0SDimitry Andric namespace llvm { 2404eeddc0SDimitry Andric namespace mca { 2504eeddc0SDimitry Andric 2604eeddc0SDimitry Andric class X86InstrPostProcess : public InstrPostProcess { 2704eeddc0SDimitry Andric /// Called within X86InstrPostProcess to specify certain instructions 2804eeddc0SDimitry Andric /// as load and store barriers. 2904eeddc0SDimitry Andric void setMemBarriers(std::unique_ptr<Instruction> &Inst, const MCInst &MCI); 3004eeddc0SDimitry Andric 3104eeddc0SDimitry Andric public: X86InstrPostProcess(const MCSubtargetInfo & STI,const MCInstrInfo & MCII)3204eeddc0SDimitry Andric X86InstrPostProcess(const MCSubtargetInfo &STI, const MCInstrInfo &MCII) 3304eeddc0SDimitry Andric : InstrPostProcess(STI, MCII) {} 3404eeddc0SDimitry Andric 3581ad6265SDimitry Andric ~X86InstrPostProcess() = default; 3604eeddc0SDimitry Andric 3704eeddc0SDimitry Andric void postProcessInstruction(std::unique_ptr<Instruction> &Inst, 3804eeddc0SDimitry Andric const MCInst &MCI) override; 3904eeddc0SDimitry Andric }; 4004eeddc0SDimitry Andric 4104eeddc0SDimitry Andric } // namespace mca 4204eeddc0SDimitry Andric } // namespace llvm 4304eeddc0SDimitry Andric 4404eeddc0SDimitry Andric #endif 45