[llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCSubtarget.cpp PPCSubtarget.h PPCTargetMachine.cpp PPCTargetMachine.h
Jim Laskey
jlaskey at apple.com
Tue Nov 1 12:07:12 PST 2005
Changes in directory llvm/lib/Target/PowerPC:
PPCSubtarget.cpp updated: 1.14 -> 1.15
PPCSubtarget.h updated: 1.11 -> 1.12
PPCTargetMachine.cpp updated: 1.75 -> 1.76
PPCTargetMachine.h updated: 1.14 -> 1.15
---
Log message:
Allow itineraries to be passed through the Target Machine.
---
Diffs of the changes: (+21 -5)
PPCSubtarget.cpp | 1 +
PPCSubtarget.h | 9 +++++++++
PPCTargetMachine.cpp | 3 ++-
PPCTargetMachine.h | 13 +++++++++----
4 files changed, 21 insertions(+), 5 deletions(-)
Index: llvm/lib/Target/PowerPC/PPCSubtarget.cpp
diff -u llvm/lib/Target/PowerPC/PPCSubtarget.cpp:1.14 llvm/lib/Target/PowerPC/PPCSubtarget.cpp:1.15
--- llvm/lib/Target/PowerPC/PPCSubtarget.cpp:1.14 Wed Oct 26 12:30:34 2005
+++ llvm/lib/Target/PowerPC/PPCSubtarget.cpp Tue Nov 1 14:07:00 2005
@@ -71,6 +71,7 @@
PPCSubtarget::PPCSubtarget(const Module &M, const std::string &FS)
: StackAlignment(16)
+ , InstrItins()
, IsGigaProcessor(false)
, Is64Bit(false)
, Has64BitRegs(false)
Index: llvm/lib/Target/PowerPC/PPCSubtarget.h
diff -u llvm/lib/Target/PowerPC/PPCSubtarget.h:1.11 llvm/lib/Target/PowerPC/PPCSubtarget.h:1.12
--- llvm/lib/Target/PowerPC/PPCSubtarget.h:1.11 Wed Oct 26 13:07:50 2005
+++ llvm/lib/Target/PowerPC/PPCSubtarget.h Tue Nov 1 14:07:00 2005
@@ -14,6 +14,7 @@
#ifndef POWERPCSUBTARGET_H
#define POWERPCSUBTARGET_H
+#include "llvm/Target/TargetInstrItineraries.h"
#include "llvm/Target/TargetSubtarget.h"
#include <string>
@@ -26,6 +27,9 @@
/// stackAlignment - The minimum alignment known to hold of the stack frame on
/// entry to the function and which must be maintained by every function.
unsigned StackAlignment;
+
+ /// Selected instruction itineraries (one entry per itinerary class.)
+ InstrItineraryData InstrItins;
/// Used by the ISel to turn in optimizations for POWER4-derived architectures
bool IsGigaProcessor;
@@ -49,6 +53,11 @@
/// stack frame on entry to the function and which must be maintained by every
/// function for this subtarget.
unsigned getStackAlignment() const { return StackAlignment; }
+
+ /// getInstrItins - Return the instruction itineraies based on subtarget
+ /// selection.
+ const InstrItineraryData getInstrItineraryData() const { return InstrItins; }
+
bool hasFSQRT() const { return HasFSQRT; }
bool has64BitRegs() const { return Has64BitRegs; }
Index: llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
diff -u llvm/lib/Target/PowerPC/PPCTargetMachine.cpp:1.75 llvm/lib/Target/PowerPC/PPCTargetMachine.cpp:1.76
--- llvm/lib/Target/PowerPC/PPCTargetMachine.cpp:1.75 Mon Oct 17 19:28:58 2005
+++ llvm/lib/Target/PowerPC/PPCTargetMachine.cpp Tue Nov 1 14:07:00 2005
@@ -64,7 +64,8 @@
PPCTargetMachine::PPCTargetMachine(const Module &M, IntrinsicLowering *IL,
const std::string &FS)
: TargetMachine("PowerPC", IL, false, 4, 4, 4, 4, 4, 4, 2, 1, 1),
- Subtarget(M, FS), FrameInfo(*this, false), JITInfo(*this) {
+ Subtarget(M, FS), FrameInfo(*this, false), JITInfo(*this),
+ InstrItins(Subtarget.getInstrItineraryData()) {
if (TargetDefault == PPCTarget) {
if (Subtarget.isAIX()) PPCTarget = TargetAIX;
if (Subtarget.isDarwin()) PPCTarget = TargetDarwin;
Index: llvm/lib/Target/PowerPC/PPCTargetMachine.h
diff -u llvm/lib/Target/PowerPC/PPCTargetMachine.h:1.14 llvm/lib/Target/PowerPC/PPCTargetMachine.h:1.15
--- llvm/lib/Target/PowerPC/PPCTargetMachine.h:1.14 Sun Oct 16 00:39:50 2005
+++ llvm/lib/Target/PowerPC/PPCTargetMachine.h Tue Nov 1 14:07:00 2005
@@ -27,10 +27,11 @@
class IntrinsicLowering;
class PPCTargetMachine : public TargetMachine {
- PPCInstrInfo InstrInfo;
- PPCSubtarget Subtarget;
- PPCFrameInfo FrameInfo;
- PPCJITInfo JITInfo;
+ PPCInstrInfo InstrInfo;
+ PPCSubtarget Subtarget;
+ PPCFrameInfo FrameInfo;
+ PPCJITInfo JITInfo;
+ InstrItineraryData InstrItins;
public:
PPCTargetMachine(const Module &M, IntrinsicLowering *IL,
const std::string &FS);
@@ -42,6 +43,10 @@
virtual const MRegisterInfo *getRegisterInfo() const {
return &InstrInfo.getRegisterInfo();
}
+ virtual const InstrItineraryData getInstrItineraryData() const {
+ return InstrItins;
+ }
+
static unsigned getJITMatchQuality();
More information about the llvm-commits
mailing list