Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:44:16

0001 //===---------------------- EntryStage.h ------------------------*- C++ -*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 /// \file
0009 ///
0010 /// This file defines the Entry stage of an instruction pipeline.  Its sole
0011 /// purpose in life is to pick instructions in sequence and move them to the
0012 /// next pipeline stage.
0013 ///
0014 //===----------------------------------------------------------------------===//
0015 
0016 #ifndef LLVM_MCA_STAGES_ENTRYSTAGE_H
0017 #define LLVM_MCA_STAGES_ENTRYSTAGE_H
0018 
0019 #include "llvm/ADT/SmallVector.h"
0020 #include "llvm/MCA/SourceMgr.h"
0021 #include "llvm/MCA/Stages/Stage.h"
0022 
0023 namespace llvm {
0024 namespace mca {
0025 
0026 class EntryStage final : public Stage {
0027   InstRef CurrentInstruction;
0028   SmallVector<std::unique_ptr<Instruction>, 16> Instructions;
0029   SourceMgr &SM;
0030   unsigned NumRetired;
0031 
0032   // Updates the program counter, and sets 'CurrentInstruction'.
0033   Error getNextInstruction();
0034 
0035   EntryStage(const EntryStage &Other) = delete;
0036   EntryStage &operator=(const EntryStage &Other) = delete;
0037 
0038 public:
0039   EntryStage(SourceMgr &SM) : SM(SM), NumRetired(0) {}
0040 
0041   bool isAvailable(const InstRef &IR) const override;
0042   bool hasWorkToComplete() const override;
0043   Error execute(InstRef &IR) override;
0044   Error cycleStart() override;
0045   Error cycleResume() override;
0046   Error cycleEnd() override;
0047 };
0048 
0049 } // namespace mca
0050 } // namespace llvm
0051 
0052 #endif // LLVM_MCA_STAGES_ENTRYSTAGE_H