//
//===----------------------------------------------------------------------===//
+#include "HexagonInstrInfo.h"
#include "HexagonMachineScheduler.h"
#include "HexagonSubtarget.h"
#include "llvm/CodeGen/MachineLoopInfo.h"
#define DEBUG_TYPE "machine-scheduler"
-namespace {
-class HexagonCallMutation : public ScheduleDAGMutation {
-public:
- void apply(ScheduleDAGInstrs *DAG) override;
-private:
- bool shouldTFRICallBind(const HexagonInstrInfo &HII,
- const SUnit &Inst1, const SUnit &Inst2) const;
-};
-} // end anonymous namespace
-
// Check if a call and subsequent A2_tfrpi instructions should maintain
// scheduling affinity. We are looking for the TFRI to be consumed in
// the next instruction. This should help reduce the instances of
assert((!llvm::ForceTopDown || !llvm::ForceBottomUp) &&
"-misched-topdown incompatible with -misched-bottomup");
-
- DAG->addMutation(make_unique<HexagonSubtarget::HexagonDAGMutation>());
- DAG->addMutation(make_unique<HexagonCallMutation>());
}
void ConvergingVLIWScheduler::releaseTopNode(SUnit *SU) {
#endif
};
-} // namespace
+class HexagonCallMutation : public ScheduleDAGMutation {
+public:
+ void apply(ScheduleDAGInstrs *DAG) override;
+private:
+ bool shouldTFRICallBind(const HexagonInstrInfo &HII,
+ const SUnit &Inst1, const SUnit &Inst2) const;
+};
+} // namespace
#endif
int HexagonTargetMachineModule = 0;
static ScheduleDAGInstrs *createVLIWMachineSched(MachineSchedContext *C) {
- return new VLIWMachineScheduler(C, make_unique<ConvergingVLIWScheduler>());
+ ScheduleDAGMILive *DAG =
+ new VLIWMachineScheduler(C, make_unique<ConvergingVLIWScheduler>());
+ DAG->addMutation(make_unique<HexagonSubtarget::HexagonDAGMutation>());
+ DAG->addMutation(make_unique<HexagonCallMutation>());
+ DAG->addMutation(createCopyConstrainDAGMutation(DAG->TII, DAG->TRI));
+ return DAG;
}
static MachineSchedRegistry