TargetSchedule.cpp revision e1b53287179b4b9b5c3c549586f688d3fa2ae8ef
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
20using namespace llvm;
21
22static cl::opt<bool> EnableSchedModel("schedmodel", cl::Hidden, cl::init(false),
23  cl::desc("Use TargetSchedModel for latency lookup"));
24
25void 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}
33