1 //===- TargetSchedule.td - Target Independent Scheduling ---*- tablegen -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file was developed by James M. Laskey and is distributed under
6 // the University of Illinois Open Source License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file defines the target-independent scheduling interfaces which should
11 // be implemented by each target which is using TableGen based scheduling.
13 //===----------------------------------------------------------------------===//
15 //===----------------------------------------------------------------------===//
16 // Processor functional unit - These values represent the function units
17 // available across all chip sets for the target. Eg., IntUnit, FPUnit, ...
18 // These may be independent values for each chip set or may be shared across
19 // all chip sets of the target. Each functional unit is treated as a resource
20 // during scheduling and has an affect instruction order based on availability
21 // during a time interval.
25 //===----------------------------------------------------------------------===//
26 // Instruction stage - These values represent a step in the execution of an
27 // instruction. The latency represents the number of discrete time slots used
28 // need to complete the stage. Units represent the choice of functional units
29 // that can be used to complete the stage. Eg. IntUnit1, IntUnit2.
31 class InstrStage<int cycles, list<FuncUnit> units> {
32 int Cycles = cycles; // length of stage in machine cycles
33 list<FuncUnit> Units = units; // choice of functional units
36 //===----------------------------------------------------------------------===//
37 // Instruction itinerary - An itinerary represents a sequential series of steps
38 // required to complete an instruction. Itineraries are represented as lists of
39 // instruction stages.
42 //===----------------------------------------------------------------------===//
43 // Instruction itinerary classes - These values represent 'named' instruction
44 // itinerary. Using named itineraries simplifies managing groups of
45 // instructions across chip sets. An instruction uses the same itinerary class
46 // across all chip sets. Thus a new chip set can be added without modifying
47 // instruction information.
50 def NoItinerary : InstrItinClass;
52 //===----------------------------------------------------------------------===//
53 // Instruction itinerary data - These values provide a runtime map of an
54 // instruction itinerary class (name) to it's itinerary data.
56 class InstrItinData<InstrItinClass Class, list<InstrStage> stages> {
57 InstrItinClass TheClass = Class;
58 list<InstrStage> Stages = stages;
61 //===----------------------------------------------------------------------===//
62 // Processor itineraries - These values represent the set of all itinerary
63 // classes for a given chip set.
65 class ProcessorItineraries<list<InstrItinData> iid> {
66 list<InstrItinData> IID = iid;
69 // NoItineraries - A marker that can be used by processors without schedule
71 def NoItineraries : ProcessorItineraries<[]>;