blob: 42effb415b7d21c380fdcf5112283f651f5eed69 [file] [log] [blame]
Andrew Trick99ab6c62012-09-14 20:26:46 +00001//===-- 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}