X86CustomBehaviour.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. //===-------------------- X86CustomBehaviour.h ------------------*-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. /// \file
  9. ///
  10. /// This file defines the X86CustomBehaviour class which inherits from
  11. /// CustomBehaviour. This class is used by the tool llvm-mca to enforce
  12. /// target specific behaviour that is not expressed well enough in the
  13. /// scheduling model for mca to enforce it automatically.
  14. ///
  15. //===----------------------------------------------------------------------===//
  16. #ifndef LLVM_LIB_TARGET_X86_MCA_X86CUSTOMBEHAVIOUR_H
  17. #define LLVM_LIB_TARGET_X86_MCA_X86CUSTOMBEHAVIOUR_H
  18. #include "llvm/ADT/SmallVector.h"
  19. #include "llvm/MCA/CustomBehaviour.h"
  20. #include "llvm/Support/TargetParser.h"
  21. namespace llvm {
  22. namespace mca {
  23. class X86InstrPostProcess : public InstrPostProcess {
  24. void processWaitCnt(std::unique_ptr<Instruction> &Inst, const MCInst &MCI);
  25. /// Called within X86InstrPostProcess to specify certain instructions
  26. /// as load and store barriers.
  27. void setMemBarriers(std::unique_ptr<Instruction> &Inst, const MCInst &MCI);
  28. public:
  29. X86InstrPostProcess(const MCSubtargetInfo &STI, const MCInstrInfo &MCII)
  30. : InstrPostProcess(STI, MCII) {}
  31. ~X86InstrPostProcess() {}
  32. void postProcessInstruction(std::unique_ptr<Instruction> &Inst,
  33. const MCInst &MCI) override;
  34. };
  35. } // namespace mca
  36. } // namespace llvm
  37. #endif