CustomBehaviour.cpp 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. //===--------------------- CustomBehaviour.cpp ------------------*- 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 implements methods from the CustomBehaviour interface.
  11. ///
  12. //===----------------------------------------------------------------------===//
  13. #include "llvm/MCA/CustomBehaviour.h"
  14. namespace llvm {
  15. namespace mca {
  16. CustomBehaviour::~CustomBehaviour() = default;
  17. unsigned CustomBehaviour::checkCustomHazard(ArrayRef<InstRef> IssuedInst,
  18. const InstRef &IR) {
  19. // 0 signifies that there are no hazards that need to be waited on
  20. return 0;
  21. }
  22. std::vector<std::unique_ptr<View>>
  23. CustomBehaviour::getStartViews(llvm::MCInstPrinter &IP,
  24. llvm::ArrayRef<llvm::MCInst> Insts) {
  25. return std::vector<std::unique_ptr<View>>();
  26. }
  27. std::vector<std::unique_ptr<View>>
  28. CustomBehaviour::getPostInstrInfoViews(llvm::MCInstPrinter &IP,
  29. llvm::ArrayRef<llvm::MCInst> Insts) {
  30. return std::vector<std::unique_ptr<View>>();
  31. }
  32. std::vector<std::unique_ptr<View>>
  33. CustomBehaviour::getEndViews(llvm::MCInstPrinter &IP,
  34. llvm::ArrayRef<llvm::MCInst> Insts) {
  35. return std::vector<std::unique_ptr<View>>();
  36. }
  37. SharedInstrument InstrumentManager::createInstrument(llvm::StringRef Desc,
  38. llvm::StringRef Data) {
  39. return std::make_shared<Instrument>(Desc, Data);
  40. }
  41. unsigned InstrumentManager::getSchedClassID(
  42. const MCInstrInfo &MCII, const MCInst &MCI,
  43. const llvm::SmallVector<SharedInstrument> &IVec) const {
  44. return MCII.get(MCI.getOpcode()).getSchedClass();
  45. }
  46. } // namespace mca
  47. } // namespace llvm