[llvm-commits] CVS: llvm/include/llvm/Target/TargetInstrInfo.h TargetInstrItineraries.h TargetMachine.h
Jim Laskey
jlaskey at apple.com
Tue Nov 1 12:07:12 PST 2005
Changes in directory llvm/include/llvm/Target:
TargetInstrInfo.h updated: 1.80 -> 1.81
TargetInstrItineraries.h updated: 1.1 -> 1.2
TargetMachine.h updated: 1.57 -> 1.58
---
Log message:
Allow itineraries to be passed through the Target Machine.
---
Diffs of the changes: (+60 -1)
TargetInstrInfo.h | 1
TargetInstrItineraries.h | 52 +++++++++++++++++++++++++++++++++++++++++++++++
TargetMachine.h | 8 +++++++
3 files changed, 60 insertions(+), 1 deletion(-)
Index: llvm/include/llvm/Target/TargetInstrInfo.h
diff -u llvm/include/llvm/Target/TargetInstrInfo.h:1.80 llvm/include/llvm/Target/TargetInstrInfo.h:1.81
--- llvm/include/llvm/Target/TargetInstrInfo.h:1.80 Fri Sep 2 13:16:20 2005
+++ llvm/include/llvm/Target/TargetInstrInfo.h Tue Nov 1 14:07:00 2005
@@ -146,7 +146,6 @@
return get(Opcode).numOperands;
}
-
InstrSchedClass getSchedClass(MachineOpCode Opcode) const {
return get(Opcode).schedClass;
}
Index: llvm/include/llvm/Target/TargetInstrItineraries.h
diff -u llvm/include/llvm/Target/TargetInstrItineraries.h:1.1 llvm/include/llvm/Target/TargetInstrItineraries.h:1.2
--- llvm/include/llvm/Target/TargetInstrItineraries.h:1.1 Thu Oct 27 13:18:05 2005
+++ llvm/include/llvm/Target/TargetInstrItineraries.h Tue Nov 1 14:07:00 2005
@@ -16,6 +16,8 @@
#ifndef LLVM_TARGET_TARGETINSTRITINERARIES_H
#define LLVM_TARGET_TARGETINSTRITINERARIES_H
+#include "llvm/Support/Debug.h"
+
namespace llvm {
//===----------------------------------------------------------------------===//
@@ -41,6 +43,56 @@
};
+
+//===----------------------------------------------------------------------===//
+// Instruction itinerary Data - Itinerary data supplied by a subtarget to be
+// used by a target.
+//
+class InstrItineraryData {
+ InstrStage *Stages; // Array of stages selected
+ unsigned NStages; // Number of stages
+ InstrItinerary *Itineratries; // Array of itineraries selected
+ unsigned NItineraries; // Number of itineraries (actually classes)
+
+public:
+
+ //
+ // Ctors.
+ //
+ InstrItineraryData()
+ : Stages(NULL), NStages(0), Itineratries(NULL), NItineraries(0)
+ {}
+ InstrItineraryData(InstrStage *S, unsigned NS, InstrItinerary *I, unsigned NI)
+ : Stages(S), NStages(NS), Itineratries(I), NItineraries(NI)
+ {}
+
+ //
+ // isEmpty - Returns true if there are no itineraries.
+ //
+ inline bool isEmpty() const { return NItineraries == 0; }
+
+ //
+ // begin - Return the first stage of the itinerary.
+ //
+ inline InstrStage *begin(unsigned ItinClassIndx) const {
+ assert(ItinClassIndx < NItineraries && "Itinerary index out of range");
+ unsigned StageIdx = Itineratries[ItinClassIndx].First;
+ assert(StageIdx < NStages && "Stage index out of range");
+ return Stages + StageIdx;
+ }
+
+ //
+ // end - Return the last+1 stage of the itinerary.
+ //
+ inline InstrStage *end(unsigned ItinClassIndx) const {
+ assert(ItinClassIndx < NItineraries && "Itinerary index out of range");
+ unsigned StageIdx = Itineratries[ItinClassIndx].Last;
+ assert(StageIdx < NStages && "Stage index out of range");
+ return Stages + StageIdx;
+ }
+};
+
+
} // End llvm namespace
#endif
Index: llvm/include/llvm/Target/TargetMachine.h
diff -u llvm/include/llvm/Target/TargetMachine.h:1.57 llvm/include/llvm/Target/TargetMachine.h:1.58
--- llvm/include/llvm/Target/TargetMachine.h:1.57 Fri Aug 5 16:53:21 2005
+++ llvm/include/llvm/Target/TargetMachine.h Tue Nov 1 14:07:00 2005
@@ -15,6 +15,7 @@
#define LLVM_TARGET_TARGETMACHINE_H
#include "llvm/Target/TargetData.h"
+#include "llvm/Target/TargetInstrItineraries.h"
#include <cassert>
namespace llvm {
@@ -122,6 +123,13 @@
/// otherwise return null.
///
virtual TargetJITInfo *getJITInfo() { return 0; }
+
+ /// getInstrItineraryData - Returns instruction itinerary data for the target
+ /// or specific subtarget.
+ ///
+ virtual const InstrItineraryData getInstrItineraryData() const {
+ return InstrItineraryData();
+ }
// These are deprecated interfaces.
virtual const TargetSchedInfo *getSchedInfo() const { return 0; }
More information about the llvm-commits
mailing list