2009-02-06 17:12:10 +00:00
|
|
|
//==- ScheduleDAGInstrs.h - MachineInstr Scheduling --------------*- C++ -*-==//
|
2008-11-19 23:18:57 +00:00
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This file implements the ScheduleDAGInstrs class, which implements
|
|
|
|
// scheduling for a MachineInstr-based dependency graph.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2009-02-06 17:12:10 +00:00
|
|
|
#ifndef SCHEDULEDAGINSTRS_H
|
|
|
|
#define SCHEDULEDAGINSTRS_H
|
2008-11-19 23:18:57 +00:00
|
|
|
|
2009-02-10 23:27:53 +00:00
|
|
|
#include "llvm/CodeGen/MachineDominators.h"
|
|
|
|
#include "llvm/CodeGen/MachineLoopInfo.h"
|
2008-11-19 23:18:57 +00:00
|
|
|
#include "llvm/CodeGen/ScheduleDAG.h"
|
2009-02-10 23:27:53 +00:00
|
|
|
#include "llvm/Support/Compiler.h"
|
2009-01-15 19:20:50 +00:00
|
|
|
#include "llvm/Target/TargetRegisterInfo.h"
|
2009-09-18 21:02:19 +00:00
|
|
|
#include "llvm/ADT/SmallSet.h"
|
2012-02-22 21:59:00 +00:00
|
|
|
#include "llvm/ADT/SparseSet.h"
|
2009-02-10 23:27:53 +00:00
|
|
|
#include <map>
|
2008-11-19 23:18:57 +00:00
|
|
|
|
|
|
|
namespace llvm {
|
2008-12-16 03:25:46 +00:00
|
|
|
class MachineLoopInfo;
|
|
|
|
class MachineDominatorTree;
|
2012-02-22 06:08:11 +00:00
|
|
|
class LiveIntervals;
|
2012-04-24 17:56:43 +00:00
|
|
|
class RegPressureTracker;
|
2008-12-16 03:25:46 +00:00
|
|
|
|
2009-02-10 23:27:53 +00:00
|
|
|
/// LoopDependencies - This class analyzes loop-oriented register
|
|
|
|
/// dependencies, which are used to guide scheduling decisions.
|
|
|
|
/// For example, loop induction variable increments should be
|
|
|
|
/// scheduled as soon as possible after the variable's last use.
|
|
|
|
///
|
2012-03-07 23:01:02 +00:00
|
|
|
class LoopDependencies {
|
2009-02-10 23:27:53 +00:00
|
|
|
const MachineDominatorTree &MDT;
|
|
|
|
|
|
|
|
public:
|
|
|
|
typedef std::map<unsigned, std::pair<const MachineOperand *, unsigned> >
|
|
|
|
LoopDeps;
|
|
|
|
LoopDeps Deps;
|
|
|
|
|
2012-06-06 18:25:08 +00:00
|
|
|
LoopDependencies(const MachineDominatorTree &mdt) : MDT(mdt) {}
|
2009-02-10 23:27:53 +00:00
|
|
|
|
|
|
|
/// VisitLoop - Clear out any previous state and analyze the given loop.
|
|
|
|
///
|
|
|
|
void VisitLoop(const MachineLoop *Loop) {
|
2011-10-07 06:33:09 +00:00
|
|
|
assert(Deps.empty() && "stale loop dependencies");
|
|
|
|
|
2009-02-10 23:27:53 +00:00
|
|
|
MachineBasicBlock *Header = Loop->getHeader();
|
|
|
|
SmallSet<unsigned, 8> LoopLiveIns;
|
|
|
|
for (MachineBasicBlock::livein_iterator LI = Header->livein_begin(),
|
|
|
|
LE = Header->livein_end(); LI != LE; ++LI)
|
|
|
|
LoopLiveIns.insert(*LI);
|
|
|
|
|
|
|
|
const MachineDomTreeNode *Node = MDT.getNode(Header);
|
|
|
|
const MachineBasicBlock *MBB = Node->getBlock();
|
|
|
|
assert(Loop->contains(MBB) &&
|
|
|
|
"Loop does not contain header!");
|
|
|
|
VisitRegion(Node, MBB, Loop, LoopLiveIns);
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
void VisitRegion(const MachineDomTreeNode *Node,
|
|
|
|
const MachineBasicBlock *MBB,
|
|
|
|
const MachineLoop *Loop,
|
|
|
|
const SmallSet<unsigned, 8> &LoopLiveIns) {
|
|
|
|
unsigned Count = 0;
|
|
|
|
for (MachineBasicBlock::const_iterator I = MBB->begin(), E = MBB->end();
|
2010-06-29 04:48:13 +00:00
|
|
|
I != E; ++I) {
|
2009-02-10 23:27:53 +00:00
|
|
|
const MachineInstr *MI = I;
|
2010-06-29 04:48:13 +00:00
|
|
|
if (MI->isDebugValue())
|
|
|
|
continue;
|
2009-02-10 23:27:53 +00:00
|
|
|
for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) {
|
|
|
|
const MachineOperand &MO = MI->getOperand(i);
|
|
|
|
if (!MO.isReg() || !MO.isUse())
|
|
|
|
continue;
|
|
|
|
unsigned MOReg = MO.getReg();
|
|
|
|
if (LoopLiveIns.count(MOReg))
|
|
|
|
Deps.insert(std::make_pair(MOReg, std::make_pair(&MO, Count)));
|
|
|
|
}
|
2010-06-29 04:48:13 +00:00
|
|
|
++Count; // Not every iteration due to dbg_value above.
|
2009-02-10 23:27:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
const std::vector<MachineDomTreeNode*> &Children = Node->getChildren();
|
|
|
|
for (std::vector<MachineDomTreeNode*>::const_iterator I =
|
|
|
|
Children.begin(), E = Children.end(); I != E; ++I) {
|
|
|
|
const MachineDomTreeNode *ChildNode = *I;
|
|
|
|
MachineBasicBlock *ChildBlock = ChildNode->getBlock();
|
|
|
|
if (Loop->contains(ChildBlock))
|
|
|
|
VisitRegion(ChildNode, ChildBlock, Loop, LoopLiveIns);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2012-03-07 23:00:57 +00:00
|
|
|
/// An individual mapping from virtual register number to SUnit.
|
|
|
|
struct VReg2SUnit {
|
|
|
|
unsigned VirtReg;
|
|
|
|
SUnit *SU;
|
|
|
|
|
|
|
|
VReg2SUnit(unsigned reg, SUnit *su): VirtReg(reg), SU(su) {}
|
|
|
|
|
2012-04-20 20:05:28 +00:00
|
|
|
unsigned getSparseSetIndex() const {
|
2012-03-07 23:00:57 +00:00
|
|
|
return TargetRegisterInfo::virtReg2Index(VirtReg);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
/// Combine a SparseSet with a 1x1 vector to track physical registers.
|
|
|
|
/// The SparseSet allows iterating over the (few) live registers for quickly
|
|
|
|
/// comparing against a regmask or clearing the set.
|
|
|
|
///
|
|
|
|
/// Storage for the map is allocated once for the pass. The map can be
|
|
|
|
/// cleared between scheduling regions without freeing unused entries.
|
|
|
|
class Reg2SUnitsMap {
|
|
|
|
SparseSet<unsigned> PhysRegSet;
|
|
|
|
std::vector<std::vector<SUnit*> > SUnits;
|
|
|
|
public:
|
|
|
|
typedef SparseSet<unsigned>::const_iterator const_iterator;
|
|
|
|
|
|
|
|
// Allow iteration over register numbers (keys) in the map. If needed, we
|
|
|
|
// can provide an iterator over SUnits (values) as well.
|
|
|
|
const_iterator reg_begin() const { return PhysRegSet.begin(); }
|
|
|
|
const_iterator reg_end() const { return PhysRegSet.end(); }
|
|
|
|
|
|
|
|
/// Initialize the map with the number of registers.
|
|
|
|
/// If the map is already large enough, no allocation occurs.
|
|
|
|
/// For simplicity we expect the map to be empty().
|
|
|
|
void setRegLimit(unsigned Limit);
|
|
|
|
|
|
|
|
/// Returns true if the map is empty.
|
|
|
|
bool empty() const { return PhysRegSet.empty(); }
|
|
|
|
|
|
|
|
/// Clear the map without deallocating storage.
|
|
|
|
void clear();
|
|
|
|
|
|
|
|
bool contains(unsigned Reg) const { return PhysRegSet.count(Reg); }
|
|
|
|
|
|
|
|
/// If this register is mapped, return its existing SUnits vector.
|
|
|
|
/// Otherwise map the register and return an empty SUnits vector.
|
|
|
|
std::vector<SUnit *> &operator[](unsigned Reg) {
|
|
|
|
bool New = PhysRegSet.insert(Reg).second;
|
|
|
|
assert((!New || SUnits[Reg].empty()) && "stale SUnits vector");
|
|
|
|
(void)New;
|
|
|
|
return SUnits[Reg];
|
|
|
|
}
|
|
|
|
|
|
|
|
/// Erase an existing element without freeing memory.
|
|
|
|
void erase(unsigned Reg) {
|
|
|
|
PhysRegSet.erase(Reg);
|
|
|
|
SUnits[Reg].clear();
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
/// Use SparseSet as a SparseMap by relying on the fact that it never
|
|
|
|
/// compares ValueT's, only unsigned keys. This allows the set to be cleared
|
|
|
|
/// between scheduling regions in constant time as long as ValueT does not
|
|
|
|
/// require a destructor.
|
2012-04-20 20:05:28 +00:00
|
|
|
typedef SparseSet<VReg2SUnit, VirtReg2IndexFunctor> VReg2SUnitMap;
|
2012-03-07 23:00:57 +00:00
|
|
|
|
2009-02-10 23:27:53 +00:00
|
|
|
/// ScheduleDAGInstrs - A ScheduleDAG subclass for scheduling lists of
|
|
|
|
/// MachineInstrs.
|
2012-03-07 23:01:02 +00:00
|
|
|
class ScheduleDAGInstrs : public ScheduleDAG {
|
2012-03-07 05:21:52 +00:00
|
|
|
protected:
|
2008-12-16 03:25:46 +00:00
|
|
|
const MachineLoopInfo &MLI;
|
|
|
|
const MachineDominatorTree &MDT;
|
2009-10-18 19:58:47 +00:00
|
|
|
const MachineFrameInfo *MFI;
|
2010-09-10 01:29:16 +00:00
|
|
|
const InstrItineraryData *InstrItins;
|
2008-12-16 03:25:46 +00:00
|
|
|
|
2012-03-07 23:00:59 +00:00
|
|
|
/// Live Intervals provides reaching defs in preRA scheduling.
|
|
|
|
LiveIntervals *LIS;
|
|
|
|
|
2012-01-14 02:17:12 +00:00
|
|
|
/// isPostRA flag indicates vregs cannot be present.
|
|
|
|
bool IsPostRA;
|
|
|
|
|
2012-03-07 23:00:59 +00:00
|
|
|
/// UnitLatencies (misnamed) flag avoids computing def-use latencies, using
|
|
|
|
/// the def-side latency only.
|
|
|
|
bool UnitLatencies;
|
2012-02-22 06:08:11 +00:00
|
|
|
|
2012-04-13 23:29:54 +00:00
|
|
|
/// The standard DAG builder does not normally include terminators as DAG
|
|
|
|
/// nodes because it does not create the necessary dependencies to prevent
|
|
|
|
/// reordering. A specialized scheduler can overide
|
|
|
|
/// TargetInstrInfo::isSchedulingBoundary then enable this flag to indicate
|
|
|
|
/// it has taken responsibility for scheduling the terminator correctly.
|
|
|
|
bool CanHandleTerminators;
|
|
|
|
|
2012-03-07 05:21:52 +00:00
|
|
|
/// State specific to the current scheduling region.
|
2012-03-07 23:00:59 +00:00
|
|
|
/// ------------------------------------------------
|
2012-03-07 05:21:52 +00:00
|
|
|
|
2012-03-07 23:00:59 +00:00
|
|
|
/// The block in which to insert instructions
|
2012-03-07 05:21:52 +00:00
|
|
|
MachineBasicBlock *BB;
|
|
|
|
|
2012-03-07 23:00:52 +00:00
|
|
|
/// The beginning of the range to be scheduled.
|
2012-03-09 04:29:02 +00:00
|
|
|
MachineBasicBlock::iterator RegionBegin;
|
2012-03-07 05:21:52 +00:00
|
|
|
|
2012-03-07 23:00:52 +00:00
|
|
|
/// The end of the range to be scheduled.
|
2012-03-09 04:29:02 +00:00
|
|
|
MachineBasicBlock::iterator RegionEnd;
|
2012-03-07 05:21:52 +00:00
|
|
|
|
2012-03-09 04:29:02 +00:00
|
|
|
/// The index in BB of RegionEnd.
|
2012-03-07 23:00:52 +00:00
|
|
|
unsigned EndIndex;
|
2012-03-07 05:21:52 +00:00
|
|
|
|
2012-03-07 00:18:08 +00:00
|
|
|
/// After calling BuildSchedGraph, each machine instruction in the current
|
|
|
|
/// scheduling region is mapped to an SUnit.
|
2012-02-22 06:08:11 +00:00
|
|
|
DenseMap<MachineInstr*, SUnit*> MISUnitMap;
|
|
|
|
|
2012-03-07 23:00:59 +00:00
|
|
|
/// State internal to DAG building.
|
|
|
|
/// -------------------------------
|
2012-01-14 02:17:15 +00:00
|
|
|
|
2012-02-24 07:04:55 +00:00
|
|
|
/// Defs, Uses - Remember where defs and uses of each register are as we
|
|
|
|
/// iterate upward through the instructions. This is allocated here instead
|
|
|
|
/// of inside BuildSchedGraph to avoid the need for it to be initialized and
|
|
|
|
/// destructed for each block.
|
|
|
|
Reg2SUnitsMap Defs;
|
|
|
|
Reg2SUnitsMap Uses;
|
2011-10-07 06:27:02 +00:00
|
|
|
|
2012-02-24 07:04:55 +00:00
|
|
|
/// Track the last instructon in this region defining each virtual register.
|
2012-02-22 21:59:00 +00:00
|
|
|
VReg2SUnitMap VRegDefs;
|
2012-01-14 02:17:18 +00:00
|
|
|
|
2009-01-15 19:20:50 +00:00
|
|
|
/// PendingLoads - Remember where unknown loads are after the most recent
|
|
|
|
/// unknown store, as we iterate. As with Defs and Uses, this is here
|
|
|
|
/// to minimize construction/destruction.
|
|
|
|
std::vector<SUnit *> PendingLoads;
|
|
|
|
|
2009-02-10 23:27:53 +00:00
|
|
|
/// LoopRegs - Track which registers are used for loop-carried dependencies.
|
|
|
|
///
|
|
|
|
LoopDependencies LoopRegs;
|
|
|
|
|
2012-06-02 10:20:22 +00:00
|
|
|
/// DbgValues - Remember instruction that precedes DBG_VALUE.
|
2012-03-07 23:00:59 +00:00
|
|
|
/// These are generated by buildSchedGraph but persist so they can be
|
|
|
|
/// referenced when emitting the final schedule.
|
2011-10-07 06:27:02 +00:00
|
|
|
typedef std::vector<std::pair<MachineInstr *, MachineInstr *> >
|
2011-06-02 21:26:52 +00:00
|
|
|
DbgValueVector;
|
|
|
|
DbgValueVector DbgValues;
|
|
|
|
MachineInstr *FirstDbgValue;
|
|
|
|
|
2008-11-19 23:18:57 +00:00
|
|
|
public:
|
2009-01-15 19:20:50 +00:00
|
|
|
explicit ScheduleDAGInstrs(MachineFunction &mf,
|
|
|
|
const MachineLoopInfo &mli,
|
2012-01-14 02:17:12 +00:00
|
|
|
const MachineDominatorTree &mdt,
|
2012-02-22 06:08:11 +00:00
|
|
|
bool IsPostRAFlag,
|
|
|
|
LiveIntervals *LIS = 0);
|
2008-11-19 23:18:57 +00:00
|
|
|
|
|
|
|
virtual ~ScheduleDAGInstrs() {}
|
|
|
|
|
2012-03-07 05:21:52 +00:00
|
|
|
/// begin - Return an iterator to the top of the current scheduling region.
|
2012-03-09 04:29:02 +00:00
|
|
|
MachineBasicBlock::iterator begin() const { return RegionBegin; }
|
2012-03-07 05:21:52 +00:00
|
|
|
|
|
|
|
/// end - Return an iterator to the bottom of the current scheduling region.
|
2012-03-09 04:29:02 +00:00
|
|
|
MachineBasicBlock::iterator end() const { return RegionEnd; }
|
2012-03-07 05:21:52 +00:00
|
|
|
|
2012-03-07 23:01:09 +00:00
|
|
|
/// newSUnit - Creates a new SUnit and return a ptr to it.
|
2012-03-07 23:00:57 +00:00
|
|
|
SUnit *newSUnit(MachineInstr *MI);
|
2008-11-19 23:18:57 +00:00
|
|
|
|
2012-03-07 23:01:09 +00:00
|
|
|
/// getSUnit - Return an existing SUnit for this MI, or NULL.
|
|
|
|
SUnit *getSUnit(MachineInstr *MI) const;
|
|
|
|
|
2012-03-07 23:00:49 +00:00
|
|
|
/// startBlock - Prepare to perform scheduling in the given block.
|
|
|
|
virtual void startBlock(MachineBasicBlock *BB);
|
2012-02-22 06:08:11 +00:00
|
|
|
|
2012-03-07 23:00:49 +00:00
|
|
|
/// finishBlock - Clean up after scheduling in the given block.
|
|
|
|
virtual void finishBlock();
|
2012-03-07 05:21:52 +00:00
|
|
|
|
|
|
|
/// Initialize the scheduler state for the next scheduling region.
|
|
|
|
virtual void enterRegion(MachineBasicBlock *bb,
|
|
|
|
MachineBasicBlock::iterator begin,
|
|
|
|
MachineBasicBlock::iterator end,
|
|
|
|
unsigned endcount);
|
|
|
|
|
|
|
|
/// Notify that the scheduler has finished scheduling the current region.
|
|
|
|
virtual void exitRegion();
|
2009-02-11 04:27:20 +00:00
|
|
|
|
2012-03-07 23:00:49 +00:00
|
|
|
/// buildSchedGraph - Build SUnits from the MachineBasicBlock that we are
|
2008-11-19 23:18:57 +00:00
|
|
|
/// input.
|
2012-04-24 17:56:43 +00:00
|
|
|
void buildSchedGraph(AliasAnalysis *AA, RegPressureTracker *RPTracker = 0);
|
2008-11-19 23:18:57 +00:00
|
|
|
|
2012-03-07 23:00:49 +00:00
|
|
|
/// addSchedBarrierDeps - Add dependencies from instructions in the current
|
2010-10-23 02:10:46 +00:00
|
|
|
/// list of instructions being scheduled to scheduling barrier. We want to
|
|
|
|
/// make sure instructions which define registers that are either used by
|
|
|
|
/// the terminator or are live-out are properly scheduled. This is
|
|
|
|
/// especially important when the definition latency of the return value(s)
|
|
|
|
/// are too high to be hidden by the branch or when the liveout registers
|
|
|
|
/// used by instructions in the fallthrough block.
|
2012-03-07 23:00:49 +00:00
|
|
|
void addSchedBarrierDeps();
|
2010-10-23 02:10:46 +00:00
|
|
|
|
2012-03-07 23:00:49 +00:00
|
|
|
/// computeLatency - Compute node latency.
|
2008-11-21 00:12:10 +00:00
|
|
|
///
|
2012-03-07 23:00:49 +00:00
|
|
|
virtual void computeLatency(SUnit *SU);
|
2008-11-21 00:12:10 +00:00
|
|
|
|
2012-06-05 21:11:27 +00:00
|
|
|
/// computeOperandLatency - Return dependence edge latency using
|
2009-08-19 16:08:58 +00:00
|
|
|
/// operand use/def information
|
|
|
|
///
|
2012-06-05 21:11:27 +00:00
|
|
|
/// FindMin may be set to get the minimum vs. expected latency. Minimum
|
|
|
|
/// latency is used for scheduling groups, while expected latency is for
|
|
|
|
/// instruction cost and critical path.
|
|
|
|
virtual unsigned computeOperandLatency(SUnit *Def, SUnit *Use,
|
|
|
|
const SDep& dep,
|
|
|
|
bool FindMin = false) const;
|
2009-08-19 16:08:58 +00:00
|
|
|
|
2012-03-07 23:00:49 +00:00
|
|
|
/// schedule - Order nodes according to selected style, filling
|
2008-11-19 23:18:57 +00:00
|
|
|
/// in the Sequence member.
|
|
|
|
///
|
2012-03-07 23:00:49 +00:00
|
|
|
/// Typically, a scheduling algorithm will implement schedule() without
|
2012-03-07 05:21:54 +00:00
|
|
|
/// overriding enterRegion() or exitRegion().
|
2012-03-07 23:00:49 +00:00
|
|
|
virtual void schedule() = 0;
|
2008-11-19 23:18:57 +00:00
|
|
|
|
2012-04-01 07:24:23 +00:00
|
|
|
/// finalizeSchedule - Allow targets to perform final scheduling actions at
|
|
|
|
/// the level of the whole MachineFunction. By default does nothing.
|
|
|
|
virtual void finalizeSchedule() {}
|
|
|
|
|
2008-11-19 23:18:57 +00:00
|
|
|
virtual void dumpNode(const SUnit *SU) const;
|
|
|
|
|
2012-03-07 05:21:47 +00:00
|
|
|
/// Return a label for a DAG node that points to an instruction.
|
2008-11-19 23:18:57 +00:00
|
|
|
virtual std::string getGraphNodeLabel(const SUnit *SU) const;
|
2012-01-14 02:17:15 +00:00
|
|
|
|
2012-03-07 05:21:47 +00:00
|
|
|
/// Return a label for the region of code covered by the DAG.
|
2012-03-07 00:18:22 +00:00
|
|
|
virtual std::string getDAGName() const;
|
|
|
|
|
2012-01-14 02:17:15 +00:00
|
|
|
protected:
|
2012-02-22 06:08:11 +00:00
|
|
|
void initSUnits();
|
2012-02-23 01:52:38 +00:00
|
|
|
void addPhysRegDataDeps(SUnit *SU, const MachineOperand &MO);
|
2012-01-14 02:17:15 +00:00
|
|
|
void addPhysRegDeps(SUnit *SU, unsigned OperIdx);
|
2012-01-14 02:17:18 +00:00
|
|
|
void addVRegDefDeps(SUnit *SU, unsigned OperIdx);
|
|
|
|
void addVRegUseDeps(SUnit *SU, unsigned OperIdx);
|
2008-11-19 23:18:57 +00:00
|
|
|
};
|
2012-03-07 23:00:57 +00:00
|
|
|
|
2012-03-07 23:01:09 +00:00
|
|
|
/// newSUnit - Creates a new SUnit and return a ptr to it.
|
2012-03-07 23:00:57 +00:00
|
|
|
inline SUnit *ScheduleDAGInstrs::newSUnit(MachineInstr *MI) {
|
|
|
|
#ifndef NDEBUG
|
|
|
|
const SUnit *Addr = SUnits.empty() ? 0 : &SUnits[0];
|
|
|
|
#endif
|
|
|
|
SUnits.push_back(SUnit(MI, (unsigned)SUnits.size()));
|
|
|
|
assert((Addr == 0 || Addr == &SUnits[0]) &&
|
|
|
|
"SUnits std::vector reallocated on the fly!");
|
|
|
|
SUnits.back().OrigNode = &SUnits.back();
|
|
|
|
return &SUnits.back();
|
|
|
|
}
|
2012-03-07 23:01:09 +00:00
|
|
|
|
|
|
|
/// getSUnit - Return an existing SUnit for this MI, or NULL.
|
|
|
|
inline SUnit *ScheduleDAGInstrs::getSUnit(MachineInstr *MI) const {
|
|
|
|
DenseMap<MachineInstr*, SUnit*>::const_iterator I = MISUnitMap.find(MI);
|
|
|
|
if (I == MISUnitMap.end())
|
|
|
|
return 0;
|
|
|
|
return I->second;
|
|
|
|
}
|
2012-03-07 23:00:57 +00:00
|
|
|
} // namespace llvm
|
2008-11-19 23:18:57 +00:00
|
|
|
|
|
|
|
#endif
|