summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/ARM
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2011-07-01 20:45:01 +0000
committerEvan Cheng <evan.cheng@apple.com>2011-07-01 20:45:01 +0000
commit54b68e34322314528624fd56ec32df8968c41a94 (patch)
tree1928d04d97da90de983d3a51b9e617f98a2d2e60 /llvm/lib/Target/ARM
parentb929de3c3d5c11d6136be1f59838788b8797ac12 (diff)
downloadbcm5719-llvm-54b68e34322314528624fd56ec32df8968c41a94.tar.gz
bcm5719-llvm-54b68e34322314528624fd56ec32df8968c41a94.zip
- Added MCSubtargetInfo to capture subtarget features and scheduling
itineraries. - Refactor TargetSubtarget to be based on MCSubtargetInfo. - Change tablegen generated subtarget info to initialize MCSubtargetInfo and hide more details from targets. llvm-svn: 134257
Diffstat (limited to 'llvm/lib/Target/ARM')
-rw-r--r--llvm/lib/Target/ARM/ARMSubtarget.cpp14
-rw-r--r--llvm/lib/Target/ARM/ARMSubtarget.h5
2 files changed, 16 insertions, 3 deletions
diff --git a/llvm/lib/Target/ARM/ARMSubtarget.cpp b/llvm/lib/Target/ARM/ARMSubtarget.cpp
index 694b31385b2..01acde0ffdb 100644
--- a/llvm/lib/Target/ARM/ARMSubtarget.cpp
+++ b/llvm/lib/Target/ARM/ARMSubtarget.cpp
@@ -12,11 +12,17 @@
//===----------------------------------------------------------------------===//
#include "ARMSubtarget.h"
-#include "ARMGenSubtarget.inc"
#include "ARMBaseRegisterInfo.h"
#include "llvm/GlobalValue.h"
+#include "llvm/Target/TargetSubtarget.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/ADT/SmallVector.h"
+
+#define GET_SUBTARGETINFO_CTOR
+#define GET_SUBTARGETINFO_MC_DESC
+#define GET_SUBTARGETINFO_TARGET_DESC
+#include "ARMGenSubtarget.inc"
+
using namespace llvm;
static cl::opt<bool>
@@ -32,7 +38,8 @@ StrictAlign("arm-strict-align", cl::Hidden,
ARMSubtarget::ARMSubtarget(const std::string &TT, const std::string &CPU,
const std::string &FS, bool isT)
- : ARMArchVersion(V4)
+ : ARMGenSubtargetInfo()
+ , ARMArchVersion(V4)
, ARMProcFamily(Others)
, ARMFPUType(None)
, UseNEONForSinglePrecisionFP(false)
@@ -130,6 +137,9 @@ ARMSubtarget::ARMSubtarget(const std::string &TT, const std::string &CPU,
FSWithArch = FSWithArch + "," + FS;
ParseSubtargetFeatures(FSWithArch, CPUString);
+ // Initialize scheduling itinerary for the specified CPU.
+ InstrItins = getInstrItineraryForCPU(CPUString);
+
// After parsing Itineraries, set ItinData.IssueWidth.
computeIssueWidth();
diff --git a/llvm/lib/Target/ARM/ARMSubtarget.h b/llvm/lib/Target/ARM/ARMSubtarget.h
index 7c931730615..fbe83227315 100644
--- a/llvm/lib/Target/ARM/ARMSubtarget.h
+++ b/llvm/lib/Target/ARM/ARMSubtarget.h
@@ -19,10 +19,13 @@
#include "llvm/ADT/Triple.h"
#include <string>
+#define GET_SUBTARGETINFO_HEADER
+#include "ARMGenSubtarget.inc"
+
namespace llvm {
class GlobalValue;
-class ARMSubtarget : public TargetSubtarget {
+class ARMSubtarget : public ARMGenSubtargetInfo {
protected:
enum ARMArchEnum {
V4, V4T, V5T, V5TE, V6, V6M, V6T2, V7A, V7M
OpenPOWER on IntegriCloud