Revert r164061-r164067. Most of the new subtarget emitter.
[oota-llvm.git] / lib / CodeGen / TargetSchedule.cpp
1 //===-- llvm/Target/TargetSchedule.cpp - Sched Machine Model ----*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file implements a wrapper around MCSchedModel that allows the interface
11 // to benefit from information currently only available in TargetInstrInfo.
12 //
13 //===----------------------------------------------------------------------===//
14
15 #include "llvm/CodeGen/TargetSchedule.h"
16 #include "llvm/Target/TargetInstrInfo.h"
17 #include "llvm/Target/TargetSubtargetInfo.h"
18 #include "llvm/Support/CommandLine.h"
19
20 using namespace llvm;
21
22 static cl::opt<bool> EnableSchedModel("schedmodel", cl::Hidden, cl::init(false),
23   cl::desc("Use TargetSchedModel for latency lookup"));
24
25 void TargetSchedModel::init(const MCSchedModel &sm,
26                             const TargetSubtargetInfo *sti,
27                             const TargetInstrInfo *tii) {
28   SchedModel = sm;
29   STI = sti;
30   TII = tii;
31   STI->initInstrItins(InstrItins);
32 }