#include "llvm/ADT/GraphTraits.h"
#include "llvm/ADT/PointerIntPair.h"
#include "llvm/ADT/SmallVector.h"
+#include "llvm/Analysis/AliasAnalysis.h"
#include "llvm/CodeGen/MachineInstr.h"
#include "llvm/Target/TargetLowering.h"
namespace llvm {
- class AliasAnalysis;
class SUnit;
class MachineConstantPool;
class MachineFunction;
}
/// Return true if the specified SDep is equivalent except for latency.
- bool overlaps(const SDep &Other) const {
- if (Dep != Other.Dep) return false;
- switch (Dep.getInt()) {
- case Data:
- case Anti:
- case Output:
- return Contents.Reg == Other.Contents.Reg;
- case Order:
- return Contents.OrdKind == Other.Contents.OrdKind;
- }
- llvm_unreachable("Invalid dependency kind!");
- }
+ bool overlaps(const SDep &Other) const;
bool operator==(const SDep &Other) const {
return overlaps(Other) && Latency == Other.Latency;
}
//// getSUnit - Return the SUnit to which this edge points.
- SUnit *getSUnit() const {
- return Dep.getPointer();
- }
+ SUnit *getSUnit() const;
//// setSUnit - Assign the SUnit to which this edge points.
- void setSUnit(SUnit *SU) {
- Dep.setPointer(SU);
- }
+ void setSUnit(SUnit *SU);
/// getKind - Return an enum value representing the kind of the dependence.
- Kind getKind() const {
- return Dep.getInt();
- }
+ Kind getKind() const;
/// isCtrl - Shorthand for getKind() != SDep::Data.
bool isCtrl() const {
/// correspond to schedulable entities (e.g. instructions) and do not have a
/// valid ID. Consequently, always check for boundary nodes before accessing
/// an assoicative data structure keyed on node ID.
- bool isBoundaryNode() const { return NodeNum == BoundaryID; };
+ bool isBoundaryNode() const { return NodeNum == BoundaryID; }
/// setNode - Assign the representative SDNode for this SUnit.
/// This may be used during pre-regalloc scheduling.
void ComputeHeight();
};
+ /// Return true if the specified SDep is equivalent except for latency.
+ inline bool SDep::overlaps(const SDep &Other) const {
+ if (Dep != Other.Dep)
+ return false;
+ switch (Dep.getInt()) {
+ case Data:
+ case Anti:
+ case Output:
+ return Contents.Reg == Other.Contents.Reg;
+ case Order:
+ return Contents.OrdKind == Other.Contents.OrdKind;
+ }
+ llvm_unreachable("Invalid dependency kind!");
+ }
+
+ //// getSUnit - Return the SUnit to which this edge points.
+ inline SUnit *SDep::getSUnit() const { return Dep.getPointer(); }
+
+ //// setSUnit - Assign the SUnit to which this edge points.
+ inline void SDep::setSUnit(SUnit *SU) { Dep.setPointer(SU); }
+
+ /// getKind - Return an enum value representing the kind of the dependence.
+ inline SDep::Kind SDep::getKind() const { return Dep.getInt(); }
+
//===--------------------------------------------------------------------===//
/// SchedulingPriorityQueue - This interface is used to plug different
/// priorities computation algorithms into the list scheduler. It implements
reverse_iterator rend() { return Index2Node.rend(); }
const_reverse_iterator rend() const { return Index2Node.rend(); }
};
-} // namespace llvm
+}
#endif