aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2010-09-10 01:29:16 +0000
committerEvan Cheng <evan.cheng@apple.com>2010-09-10 01:29:16 +0000
commit3ef1c8759a20167457eb7fd82ebcaffe7ccaa1d1 (patch)
treeffcb01b1621bcedb427d701cfaee9ea9a19b0a2c /include
parent920a2089d9b737820631bc6de4c4fb9fa9ad1e07 (diff)
downloadexternal_llvm-3ef1c8759a20167457eb7fd82ebcaffe7ccaa1d1.zip
external_llvm-3ef1c8759a20167457eb7fd82ebcaffe7ccaa1d1.tar.gz
external_llvm-3ef1c8759a20167457eb7fd82ebcaffe7ccaa1d1.tar.bz2
Teach if-converter to be more careful with predicating instructions that would
take multiple cycles to decode. For the current if-converter clients (actually only ARM), the instructions that are predicated on false are not nops. They would still take machine cycles to decode. Micro-coded instructions such as LDM / STM can potentially take multiple cycles to decode. If-converter should take treat them as non-micro-coded simple instructions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113570 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/CodeGen/PostRAHazardRecognizer.h4
-rw-r--r--include/llvm/Target/TargetInstrInfo.h6
-rw-r--r--include/llvm/Target/TargetInstrItineraries.h8
-rw-r--r--include/llvm/Target/TargetMachine.h4
4 files changed, 15 insertions, 7 deletions
diff --git a/include/llvm/CodeGen/PostRAHazardRecognizer.h b/include/llvm/CodeGen/PostRAHazardRecognizer.h
index 24d73cb..4160384 100644
--- a/include/llvm/CodeGen/PostRAHazardRecognizer.h
+++ b/include/llvm/CodeGen/PostRAHazardRecognizer.h
@@ -75,13 +75,13 @@ class PostRAHazardRecognizer : public ScheduleHazardRecognizer {
};
// Itinerary data for the target.
- const InstrItineraryData &ItinData;
+ const InstrItineraryData *ItinData;
ScoreBoard ReservedScoreboard;
ScoreBoard RequiredScoreboard;
public:
- PostRAHazardRecognizer(const InstrItineraryData &ItinData);
+ PostRAHazardRecognizer(const InstrItineraryData *ItinData);
virtual HazardType getHazardType(SUnit *SU);
virtual void Reset();
diff --git a/include/llvm/Target/TargetInstrInfo.h b/include/llvm/Target/TargetInstrInfo.h
index 7ce1f71..844b965 100644
--- a/include/llvm/Target/TargetInstrInfo.h
+++ b/include/llvm/Target/TargetInstrInfo.h
@@ -575,7 +575,7 @@ public:
/// to use for this target when scheduling the machine instructions after
/// register allocation.
virtual ScheduleHazardRecognizer*
- CreateTargetPostRAHazardRecognizer(const InstrItineraryData&) const = 0;
+ CreateTargetPostRAHazardRecognizer(const InstrItineraryData*) const = 0;
/// AnalyzeCompare - For a comparison instruction, return the source register
/// in SrcReg and the value it compares against in CmpValue. Return true if
@@ -595,7 +595,7 @@ public:
/// getNumMicroOps - Return the number of u-operations the given machine
/// instruction will be decoded to on the target cpu.
virtual unsigned getNumMicroOps(const MachineInstr *MI,
- const InstrItineraryData &ItinData) const;
+ const InstrItineraryData *ItinData) const;
};
/// TargetInstrInfoImpl - This is the default implementation of
@@ -631,7 +631,7 @@ public:
const MachineFunction &MF) const;
virtual ScheduleHazardRecognizer *
- CreateTargetPostRAHazardRecognizer(const InstrItineraryData&) const;
+ CreateTargetPostRAHazardRecognizer(const InstrItineraryData*) const;
};
} // End llvm namespace
diff --git a/include/llvm/Target/TargetInstrItineraries.h b/include/llvm/Target/TargetInstrItineraries.h
index ae3e621..ae156ea 100644
--- a/include/llvm/Target/TargetInstrItineraries.h
+++ b/include/llvm/Target/TargetInstrItineraries.h
@@ -181,6 +181,14 @@ public:
return (int)OperandCycles[FirstIdx + OperandIdx];
}
+
+ /// isMicroCoded - Return true if the instructions in the given class decode
+ /// to more than one micro-ops.
+ bool isMicroCoded(unsigned ItinClassIndx) const {
+ if (isEmpty())
+ return false;
+ return Itineratries[ItinClassIndx].NumMicroOps != 1;
+ }
};
diff --git a/include/llvm/Target/TargetMachine.h b/include/llvm/Target/TargetMachine.h
index 42e99e0..426338f 100644
--- a/include/llvm/Target/TargetMachine.h
+++ b/include/llvm/Target/TargetMachine.h
@@ -152,8 +152,8 @@ public:
/// getInstrItineraryData - Returns instruction itinerary data for the target
/// or specific subtarget.
///
- virtual const InstrItineraryData getInstrItineraryData() const {
- return InstrItineraryData();
+ virtual const InstrItineraryData *getInstrItineraryData() const {
+ return 0;
}
/// getELFWriterInfo - If this target supports an ELF writer, return