diff options
| author | Evan Cheng <evan.cheng@apple.com> | 2011-06-30 01:53:36 +0000 | 
|---|---|---|
| committer | Evan Cheng <evan.cheng@apple.com> | 2011-06-30 01:53:36 +0000 | 
| commit | fe6e405e8c8a7f75996ef44e4e7ad77c1261dc7a (patch) | |
| tree | 03699727329ebc9865d9c41f71be5b1b08c6b31b /llvm/lib/Target/MBlaze/MBlazeSubtarget.cpp | |
| parent | 91e56620753d6f717b17b3f9d1336098a60872cd (diff) | |
| download | bcm5719-llvm-fe6e405e8c8a7f75996ef44e4e7ad77c1261dc7a.tar.gz bcm5719-llvm-fe6e405e8c8a7f75996ef44e4e7ad77c1261dc7a.zip | |
Fix the ridiculous SubtargetFeatures API where it implicitly expects CPU name to
be the first encoded as the first feature. It then uses the CPU name to look up
features / scheduling itineray even though clients know full well the CPU name
being used to query these properties.
The fix is to just have the clients explictly pass the CPU name!
llvm-svn: 134127
Diffstat (limited to 'llvm/lib/Target/MBlaze/MBlazeSubtarget.cpp')
| -rw-r--r-- | llvm/lib/Target/MBlaze/MBlazeSubtarget.cpp | 14 | 
1 files changed, 9 insertions, 5 deletions
| diff --git a/llvm/lib/Target/MBlaze/MBlazeSubtarget.cpp b/llvm/lib/Target/MBlaze/MBlazeSubtarget.cpp index a80744a4769..034b5ce49c1 100644 --- a/llvm/lib/Target/MBlaze/MBlazeSubtarget.cpp +++ b/llvm/lib/Target/MBlaze/MBlazeSubtarget.cpp @@ -18,18 +18,22 @@  #include "llvm/Support/CommandLine.h"  using namespace llvm; -MBlazeSubtarget::MBlazeSubtarget(const std::string &TT, const std::string &FS): +MBlazeSubtarget::MBlazeSubtarget(const std::string &TT, +                                 const std::string &CPU, +                                 const std::string &FS):    HasBarrel(false), HasDiv(false), HasMul(false), HasPatCmp(false),    HasFPU(false), HasMul64(false), HasSqrt(false)  {    // Parse features string. -  std::string CPU = "mblaze"; -  CPU = ParseSubtargetFeatures(FS, CPU); +  std::string CPUName = CPU; +  if (CPUName.empty()) +    CPUName = "mblaze"; +  ParseSubtargetFeatures(FS, CPUName);    // 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"); +  HasItin = CPUName != "mblaze"; +  DEBUG(dbgs() << "CPU " << CPUName << "(" << HasItin << ")\n");    // Compute the issue width of the MBlaze itineraries    computeIssueWidth(); | 

