1 //===- MBlazeSubtarget.cpp - MBlaze Subtarget Information -------*- C++ -*-===//
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 file implements the MBlaze specific subclass of TargetSubtarget.
12 //===----------------------------------------------------------------------===//
14 #include "MBlazeSubtarget.h"
16 #include "MBlazeRegisterInfo.h"
17 #include "MBlazeGenSubtarget.inc"
18 #include "llvm/Support/CommandLine.h"
21 MBlazeSubtarget::MBlazeSubtarget(const std::string &TT,
22 const std::string &CPU,
23 const std::string &FS):
24 HasBarrel(false), HasDiv(false), HasMul(false), HasPatCmp(false),
25 HasFPU(false), HasMul64(false), HasSqrt(false)
27 // Parse features string.
28 std::string CPUName = CPU;
31 ParseSubtargetFeatures(FS, CPUName);
33 // Only use instruction scheduling if the selected CPU has an instruction
34 // itinerary (the default CPU is the only one that doesn't).
35 HasItin = CPUName != "mblaze";
36 DEBUG(dbgs() << "CPU " << CPUName << "(" << HasItin << ")\n");
38 // Compute the issue width of the MBlaze itineraries
42 void MBlazeSubtarget::computeIssueWidth() {
43 InstrItins.IssueWidth = 1;
46 bool MBlazeSubtarget::
47 enablePostRAScheduler(CodeGenOpt::Level OptLevel,
48 TargetSubtarget::AntiDepBreakMode& Mode,
49 RegClassVector& CriticalPathRCs) const {
50 Mode = TargetSubtarget::ANTIDEP_CRITICAL;
51 CriticalPathRCs.clear();
52 CriticalPathRCs.push_back(&MBlaze::GPRRegClass);
53 return HasItin && OptLevel >= CodeGenOpt::Default;