diff options
| author | Wesley Peck <peckw@wesleypeck.com> | 2011-04-11 22:31:52 +0000 |
|---|---|---|
| committer | Wesley Peck <peckw@wesleypeck.com> | 2011-04-11 22:31:52 +0000 |
| commit | 1914c39bd49a1de928b75eadda2368c321316fb4 (patch) | |
| tree | 0ce5e074901dfa561f9ce43bca5dcae1c0e8cfc4 /llvm/lib/Target/MBlaze/MBlazeSubtarget.cpp | |
| parent | 64749f2a893d42421f3089a643576dad1d564620 (diff) | |
| download | bcm5719-llvm-1914c39bd49a1de928b75eadda2368c321316fb4.tar.gz bcm5719-llvm-1914c39bd49a1de928b75eadda2368c321316fb4.zip | |
Add scheduling information for the MBlaze backend.
llvm-svn: 129311
Diffstat (limited to 'llvm/lib/Target/MBlaze/MBlazeSubtarget.cpp')
| -rw-r--r-- | llvm/lib/Target/MBlaze/MBlazeSubtarget.cpp | 36 |
1 files changed, 28 insertions, 8 deletions
diff --git a/llvm/lib/Target/MBlaze/MBlazeSubtarget.cpp b/llvm/lib/Target/MBlaze/MBlazeSubtarget.cpp index 34405215686..a80744a4769 100644 --- a/llvm/lib/Target/MBlaze/MBlazeSubtarget.cpp +++ b/llvm/lib/Target/MBlaze/MBlazeSubtarget.cpp @@ -13,19 +13,39 @@ #include "MBlazeSubtarget.h" #include "MBlaze.h" +#include "MBlazeRegisterInfo.h" #include "MBlazeGenSubtarget.inc" #include "llvm/Support/CommandLine.h" using namespace llvm; MBlazeSubtarget::MBlazeSubtarget(const std::string &TT, const std::string &FS): - HasPipe3(false), HasBarrel(false), HasDiv(false), HasMul(false), - HasFSL(false), HasEFSL(false), HasMSRSet(false), HasException(false), - HasPatCmp(false), HasFPU(false), HasESR(false), HasPVR(false), - HasMul64(false), HasSqrt(false), HasMMU(false) + HasBarrel(false), HasDiv(false), HasMul(false), HasPatCmp(false), + HasFPU(false), HasMul64(false), HasSqrt(false) { - std::string CPU = "v400"; - MBlazeArchVersion = V400; - // Parse features string. - ParseSubtargetFeatures(FS, CPU); + std::string CPU = "mblaze"; + CPU = ParseSubtargetFeatures(FS, CPU); + + // Only use instruction scheduling if the selected CPU has an instruction + // itinerary (the default CPU is the only one that doesn't). + HasItin = CPU != "mblaze"; + DEBUG(dbgs() << "CPU " << CPU << "(" << HasItin << ")\n"); + + // Compute the issue width of the MBlaze itineraries + computeIssueWidth(); +} + +void MBlazeSubtarget::computeIssueWidth() { + InstrItins.IssueWidth = 1; +} + +bool MBlazeSubtarget:: +enablePostRAScheduler(CodeGenOpt::Level OptLevel, + TargetSubtarget::AntiDepBreakMode& Mode, + RegClassVector& CriticalPathRCs) const { + Mode = TargetSubtarget::ANTIDEP_CRITICAL; + CriticalPathRCs.clear(); + CriticalPathRCs.push_back(&MBlaze::GPRRegClass); + return HasItin && OptLevel >= CodeGenOpt::Default; } + |

