![]() System : Linux absol.cf 5.4.0-198-generic #218-Ubuntu SMP Fri Sep 27 20:18:53 UTC 2024 x86_64 User : www-data ( 33) PHP Version : 7.4.33 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, Directory : /proc/thread-self/root/usr/include/llvm-6.0/llvm/CodeGen/ |
Upload File : |
//===---- LatencyPriorityQueue.h - A latency-oriented priority queue ------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file declares the LatencyPriorityQueue class, which is a // SchedulingPriorityQueue that schedules using latency information to // reduce the length of the critical path through the basic block. // //===----------------------------------------------------------------------===// #ifndef LLVM_CODEGEN_LATENCYPRIORITYQUEUE_H #define LLVM_CODEGEN_LATENCYPRIORITYQUEUE_H #include "llvm/CodeGen/ScheduleDAG.h" namespace llvm { class LatencyPriorityQueue; /// Sorting functions for the Available queue. struct latency_sort { LatencyPriorityQueue *PQ; explicit latency_sort(LatencyPriorityQueue *pq) : PQ(pq) {} bool operator()(const SUnit* left, const SUnit* right) const; }; class LatencyPriorityQueue : public SchedulingPriorityQueue { // SUnits - The SUnits for the current graph. std::vector<SUnit> *SUnits; /// NumNodesSolelyBlocking - This vector contains, for every node in the /// Queue, the number of nodes that the node is the sole unscheduled /// predecessor for. This is used as a tie-breaker heuristic for better /// mobility. std::vector<unsigned> NumNodesSolelyBlocking; /// Queue - The queue. std::vector<SUnit*> Queue; latency_sort Picker; public: LatencyPriorityQueue() : Picker(this) { } bool isBottomUp() const override { return false; } void initNodes(std::vector<SUnit> &sunits) override { SUnits = &sunits; NumNodesSolelyBlocking.resize(SUnits->size(), 0); } void addNode(const SUnit *SU) override { NumNodesSolelyBlocking.resize(SUnits->size(), 0); } void updateNode(const SUnit *SU) override { } void releaseState() override { SUnits = nullptr; } unsigned getLatency(unsigned NodeNum) const { assert(NodeNum < (*SUnits).size()); return (*SUnits)[NodeNum].getHeight(); } unsigned getNumSolelyBlockNodes(unsigned NodeNum) const { assert(NodeNum < NumNodesSolelyBlocking.size()); return NumNodesSolelyBlocking[NodeNum]; } bool empty() const override { return Queue.empty(); } void push(SUnit *U) override; SUnit *pop() override; void remove(SUnit *SU) override; // scheduledNode - As nodes are scheduled, we look to see if there are any // successor nodes that have a single unscheduled predecessor. If so, that // single predecessor has a higher priority, since scheduling it will make // the node available. void scheduledNode(SUnit *Node) override; private: void AdjustPriorityOfUnscheduledPreds(SUnit *SU); SUnit *getSingleUnscheduledPred(SUnit *SU); }; } #endif