diff options
author | Evan Cheng <evan.cheng@apple.com> | 2010-10-26 02:08:50 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2010-10-26 02:08:50 +0000 |
commit | c8141dfc7f983cb04e65d8acd6bcbdc8e4b8a0ae (patch) | |
tree | 56817344997a61b27c1025c5efae26f164936b80 /lib/Target/TargetInstrInfo.cpp | |
parent | 0e9996ca94ac84c10aeddfb9b6300b2b89b08fe2 (diff) | |
download | llvm-c8141dfc7f983cb04e65d8acd6bcbdc8e4b8a0ae.tar.gz llvm-c8141dfc7f983cb04e65d8acd6bcbdc8e4b8a0ae.tar.bz2 llvm-c8141dfc7f983cb04e65d8acd6bcbdc8e4b8a0ae.tar.xz |
Use instruction itinerary to determine what instructions are 'cheap'.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117348 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/TargetInstrInfo.cpp')
-rw-r--r-- | lib/Target/TargetInstrInfo.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/Target/TargetInstrInfo.cpp b/lib/Target/TargetInstrInfo.cpp index 7f103226da..62818d0cae 100644 --- a/lib/Target/TargetInstrInfo.cpp +++ b/lib/Target/TargetInstrInfo.cpp @@ -94,6 +94,16 @@ TargetInstrInfo::getOperandLatency(const InstrItineraryData *ItinData, return ItinData->getOperandLatency(DefClass, DefIdx, UseClass, UseIdx); } +bool TargetInstrInfo::hasLowDefLatency(const InstrItineraryData *ItinData, + const MachineInstr *DefMI, + unsigned DefIdx) const { + if (!ItinData || ItinData->isEmpty()) + return false; + + unsigned DefClass = DefMI->getDesc().getSchedClass(); + int DefCycle = ItinData->getOperandCycle(DefClass, DefIdx); + return (DefCycle != -1 && DefCycle <= 1); +} /// insertNoop - Insert a noop into the instruction stream at the specified /// point. |