summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/LatencyPriorityQueue.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* ScheduleDAG: Cleanup dumping code; NFCMatthias Braun2018-09-191-2/+2
| | | | | | | | | | | | - Instead of having both `SUnit::dump(ScheduleDAG*)` and `ScheduleDAG::dumpNode(ScheduleDAG*)`, just keep the latter around. - Add `ScheduleDAG::dump()` and avoid code duplication in several places. Implement it for different ScheduleDAG variants. - Add `ScheduleDAG::dumpNodeName()` in favor of the `SUnit::print()` functions. They were only ever used for debug dumping and putting the function into ScheduleDAG is consistent with the `dumpNode()` change. llvm-svn: 342520
* IWYU for llvm-config.h in llvm, additions.Nico Weber2018-04-301-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | See r331124 for how I made a list of files missing the include. I then ran this Python script: for f in open('filelist.txt'): f = f.strip() fl = open(f).readlines() found = False for i in xrange(len(fl)): p = '#include "llvm/' if not fl[i].startswith(p): continue if fl[i][len(p):] > 'Config': fl.insert(i, '#include "llvm/Config/llvm-config.h"\n') found = True break if not found: print 'not found', f else: open(f, 'w').write(''.join(fl)) and then looked through everything with `svn diff | diffstat -l | xargs -n 1000 gvim -p` and tried to fix include ordering and whatnot. No intended behavior change. llvm-svn: 331184
* Move a dump() implementation out of line.Amara Emerson2018-04-201-0/+11
| | | | | | Fixes some link issues. llvm-svn: 330384
* Assert correct removal of SUnit in LatencyPriorityQueueBenjamin Kramer2017-11-161-0/+1
| | | | | | | | | | | | | | | The LatencyPriorityQueue doesn't currently check whether the SU being removed really exists in the Queue. This method fails quietly when SU is not found and removes the last element from the Queue, leading to unexpected behavior. Unfortunately, this only occurs on our custom target, with the custom scheduler. In our case, when remove() is invoked, it removes the wrong SU at the end of the Queue, which is only discovered later when VerifyScheduledDAG() is invoked and finds that some nodes were not scheduled at all. As this is only reproducible with a lot of proprietary code, I'm hopeful this assert is straightforward enough to not necessitate a test. Patch by Ondrej Glasnak! Differential Revision: https://reviews.llvm.org/D40084 llvm-svn: 318387
* Use the range variant of find instead of unpacking begin/endDavid Majnemer2016-08-111-1/+1
| | | | | | | | | If the result of the find is only used to compare against end(), just use is_contained instead. No functionality change is intended. llvm-svn: 278433
* Remove LatencyPriorityQueue::dump because it relies on an implicit copy ctor ↵David Blaikie2015-03-031-13/+0
| | | | | | | | | | | | | which is deprecated in C++11 (due to the presence of a user-declare dtor in the base class) This type could be made copyable (= default a protected copy ctor in the base class, and preferably make the derived class final to avoid risks of providing a slicing copy operation to further derived classes) but it seemed easier to avoid that complexity for a dump function that I assume (by symmetry with ResourcePriorityQueue's dump, which was actively buggy) not often used. llvm-svn: 231133
* [Modules] Remove potential ODR violations by sinking the DEBUG_TYPEChandler Carruth2014-04-221-1/+2
| | | | | | | | | | | | define below all header includes in the lib/CodeGen/... tree. While the current modules implementation doesn't check for this kind of ODR violation yet, it is likely to grow support for it in the future. It also removes one layer of macro pollution across all the included headers. Other sub-trees will follow. llvm-svn: 206837
* [C++11] More 'nullptr' conversion. In some cases just using a boolean check ↵Craig Topper2014-04-141-4/+4
| | | | | | instead of comparing to nullptr. llvm-svn: 206142
* [C++11] Replace llvm::next and llvm::prior with std::next and std::prev.Benjamin Kramer2014-03-021-3/+3
| | | | | | Remove the old functions. llvm-svn: 202636
* misched preparation: rename core scheduler methods for consistency.Andrew Trick2012-03-071-2/+2
| | | | | | | We had half the API with one convention, half with another. Now was a good time to clean it up. llvm-svn: 152255
* Initialize SUnits before DAG building.Andrew Trick2012-02-221-1/+1
| | | | | | | | | | | | Affect on SD scheduling and postRA scheduling: Printing the DAG will display the nodes in top-down topological order. This matches the order within the MBB and makes my life much easier in general. Affect on misched: We don't need to track virtual register uses at all. This is awesome. I also intend to rely on the SUnit ID as a topo-sort index. So if A < B then we cannot have an edge B -> A. llvm-svn: 151135
* Various bits of framework needed for precise machine-level selectionAndrew Trick2010-12-241-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | DAG scheduling during isel. Most new functionality is currently guarded by -enable-sched-cycles and -enable-sched-hazard. Added InstrItineraryData::IssueWidth field, currently derived from ARM itineraries, but could be initialized differently on other targets. Added ScheduleHazardRecognizer::MaxLookAhead to indicate whether it is active, and if so how many cycles of state it holds. Added SchedulingPriorityQueue::HasReadyFilter to allowing gating entry into the scheduler's available queue. ScoreboardHazardRecognizer now accesses the ScheduleDAG in order to get information about it's SUnits, provides RecedeCycle for bottom-up scheduling, correctly computes scoreboard depth, tracks IssueCount, and considers potential stall cycles when checking for hazards. ScheduleDAGRRList now models machine cycles and hazards (under flags). It tracks MinAvailableCycle, drives the hazard recognizer and priority queue's ready filter, manages a new PendingQueue, properly accounts for stall cycles, etc. llvm-svn: 122541
* whitespaceAndrew Trick2010-12-241-6/+6
| | | | llvm-svn: 122539
* Use `llvm::next' instead of `next' to make VC++ 2010 happy.Oscar Fuentes2010-05-301-1/+1
| | | | llvm-svn: 105168
* Eliminate the use of PriorityQueue and just use a std::vector,Dan Gohman2010-05-261-1/+23
| | | | | | | | implementing pop with a linear search for a "best" element. The priority queue was a neat idea, but in practice the comparison functions depend on dynamic information. llvm-svn: 104718
* Change push_all to a non-virtual function and implement it in theDan Gohman2010-05-261-1/+1
| | | | | | base class, since all the implementations are the same. llvm-svn: 104659
* Remove some old experimental code that is no longer needed. Remove ↵David Goodwin2009-11-201-12/+0
| | | | | | additional, speculative scheduling pass as its cost did not translate into significant performance improvement. Minor tweaks. llvm-svn: 89471
* Rename registers to break output dependencies in addition to anti-dependencies.David Goodwin2009-11-121-3/+12
| | | | llvm-svn: 87015
* Do a scheduling pass ignoring anti-dependencies to identify candidate ↵David Goodwin2009-11-031-2/+7
| | | | | | registers that should be renamed. llvm-svn: 85939
* Add initial support for back-scheduling address computations,Dan Gohman2008-12-161-0/+8
| | | | | | | especially in the case of addresses computed from loop induction variables. llvm-svn: 61075
* Fix some register-alias-related bugs in the post-RA scheduler livenessDan Gohman2008-12-161-41/+0
| | | | | | | | | | | | | | computation code. Also, avoid adding output-depenency edges when both defs are dead, which frequently happens with EFLAGS defs. Compute Depth and Height lazily, and always in terms of edge latency values. For the schedulers that don't care about latency, edge latencies are set to 1. Eliminate Cycle and CycleBound, and LatencyPriorityQueue's Latencies array. These are all subsumed by the Depth and Height fields. llvm-svn: 61073
* Update CalcLatency to work in terms of edge latencies, rather thanDan Gohman2008-12-101-26/+5
| | | | | | | | node latencies. Use CalcLatency instead of manual code in CalculatePriorities to keep it consistent. Previously it computed slightly different results. llvm-svn: 60817
* Rewrite the SDep class, and simplify some of the related code.Dan Gohman2008-12-091-8/+7
| | | | | | | | | | | | | | | | | The Cost field is removed. It was only being used in a very limited way, to indicate when the scheduler should attempt to protect a live register, and it isn't really needed to do that. If we ever want the scheduler to start inserting copies in non-prohibitive situations, we'll have to rethink some things anyway. A Latency field is added. Instead of giving each node a single fixed latency, each edge can have its own latency. This will eventually be used to model various micro-architecture properties more accurately. The PointerIntPair class and an internal union are now used, which reduce the overall size. llvm-svn: 60806
* Don't charge full latency for an anti-dependence, in this simplisticDan Gohman2008-12-091-3/+7
| | | | | | pipeline model. llvm-svn: 60733
* Experimental post-pass scheduling support. Post-pass schedulingDan Gohman2008-11-191-0/+165
is currently off by default, and can be enabled with -disable-post-RA-scheduler=false. This doesn't have a significant impact on most code yet because it doesn't yet do anything to address anti-dependencies and it doesn't attempt to disambiguate memory references. Also, several popular targets don't have pipeline descriptions yet. The majority of the changes here are splitting the SelectionDAG-specific code out of ScheduleDAG, so that ScheduleDAG can be moved to libLLVMCodeGen.a. The interface between ScheduleDAG-using code and the rest of the scheduling code is somewhat rough and will evolve. llvm-svn: 59676
OpenPOWER on IntegriCloud