1 //===- DFAPacketizerEmitter.h - Packetization DFA for a VLIW machine-------===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This class parses the Schedule.td file and produces an API that can be used
11 // to reason about whether an instruction can be added to a packet on a VLIW
12 // architecture. The class internally generates a deterministic finite
13 // automaton (DFA) that models all possible mappings of machine instructions
14 // to functional units as instructions are added to a packet.
16 //===----------------------------------------------------------------------===//
18 #include "llvm/ADT/DenseSet.h"
19 #include "llvm/TableGen/TableGenBackend.h"
25 // class DFAGen: class that generates and prints out the DFA for resource
28 class DFAGen : public TableGenBackend {
30 std::string TargetName;
32 // allInsnClasses is the set of all possible resources consumed by an
35 DenseSet<unsigned> allInsnClasses;
36 RecordKeeper &Records;
39 DFAGen(RecordKeeper &R);
42 // collectAllInsnClasses: Populate allInsnClasses which is a set of units
43 // used in each stage.
45 void collectAllInsnClasses(const std::string &Name,
50 void run(raw_ostream &OS);