summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp
Commit message (Collapse)AuthorAgeFilesLines
* One mundane change: Change ReplaceAllUsesOfValueWith to *optionally* Chris Lattner2007-10-151-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | take a deleted nodes vector, instead of requiring it. One more significant change: Implement the start of a legalizer that just works on types. This legalizer is designed to run before the operation legalizer and ensure just that the input dag is transformed into an output dag whose operand and result types are all legal, even if the operations on those types are not. This design/impl has the following advantages: 1. When finished, this will *significantly* reduce the amount of code in LegalizeDAG.cpp. It will remove all the code related to promotion and expansion as well as splitting and scalarizing vectors. 2. The new code is very simple, idiomatic, and modular: unlike LegalizeDAG.cpp, it has no 3000 line long functions. :) 3. The implementation is completely iterative instead of recursive, good for hacking on large dags without blowing out your stack. 4. The implementation updates nodes in place when possible instead of deallocating and reallocating the entire graph that points to some mutated node. 5. The code nicely separates out handling of operations with invalid results from operations with invalid operands, making some cases simpler and easier to understand. 6. The new -debug-only=legalize-types option is very very handy :), allowing you to easily understand what legalize types is doing. This is not yet done. Until the ifdef added to SelectionDAGISel.cpp is enabled, this does nothing. However, this code is sufficient to legalize all of the code in 186.crafty, olden and freebench on an x86 machine. The biggest issues are: 1. Vectors aren't implemented at all yet 2. SoftFP is a mess, I need to talk to Evan about it. 3. No lowering to libcalls is implemented yet. 4. Various operations are missing etc. 5. There are FIXME's for stuff I hax0r'd out, like softfp. Hey, at least it is a step in the right direction :). If you'd like to help, just enable the #ifdef in SelectionDAGISel.cpp and compile code with it. If this explodes it will tell you what needs to be implemented. Help is certainly appreciated. Once this goes in, we can do three things: 1. Add a new pass of dag combine between the "type legalizer" and "operation legalizer" passes. This will let us catch some long-standing isel issues that we miss because operation legalization often obfuscates the dag with target-specific nodes. 2. We can rip out all of the type legalization code from LegalizeDAG.cpp, making it much smaller and simpler. When that happens we can then reimplement the core functionality left in it in a much more efficient and non-recursive way. 3. Once the whole legalizer is non-recursive, we can implement whole-function selectiondags maybe... llvm-svn: 42981
* EXTRACT_SUBREG coalescing support. The coalescer now treats EXTRACT_SUBREG likeEvan Cheng2007-10-121-0/+13
| | | | | | | | | (almost) a register copy. However, it always coalesced to the register of the RHS (the super-register). All uses of the result of a EXTRACT_SUBREG are sub- register uses which adds subtle complications to load folding, spiller rewrite, etc. llvm-svn: 42899
* Fix a typo in a comment.Dan Gohman2007-10-051-1/+1
| | | | llvm-svn: 42635
* Chain producing nodes cannot be moved, not chain reading nodes.Evan Cheng2007-10-051-5/+7
| | | | llvm-svn: 42627
* Oops. Didn't mean to leave this in.Evan Cheng2007-10-051-1/+0
| | | | llvm-svn: 42626
* If a node that defines a physical register that is expensive to copy. TheEvan Cheng2007-10-051-19/+132
| | | | | | | | | scheduler will try a number of tricks in order to avoid generating the copies. This may not be possible in case the node produces a chain value that prevent movement. Try unfolding the load from the node before to allow it to be moved / cloned. llvm-svn: 42625
* If two instructions are both two-address code, favors (schedule closer toEvan Cheng2007-09-281-3/+20
| | | | | | | terminator) the one that has a CopyToReg use. This fixes 2006-05-11-InstrSched.ll with -new-cc-modeling-scheme. llvm-svn: 42453
* Remove a poor scheduling heuristic.Evan Cheng2007-09-281-34/+5
| | | | llvm-svn: 42443
* Trim some unneeded fields.Evan Cheng2007-09-281-17/+8
| | | | llvm-svn: 42442
* Avoid inserting a live register more than once.Evan Cheng2007-09-271-8/+18
| | | | llvm-svn: 42410
* Boogs.Evan Cheng2007-09-271-10/+10
| | | | llvm-svn: 42388
* Be smarter about which node to force schedule. Reduce # of duplications + ↵Evan Cheng2007-09-271-84/+120
| | | | | | copies; Added statistics. llvm-svn: 42387
* Backtracking only when it won't create a cycle.Evan Cheng2007-09-271-23/+35
| | | | llvm-svn: 42384
* - Move getPhysicalRegisterRegClass() from ScheduleDAG to MRegisterInfo.Evan Cheng2007-09-261-65/+145
| | | | | | | - Added ability to emit cross class register copies to the BBRU scheduler. - More aggressive backtracking. llvm-svn: 42375
* Added major new capabilities to scheduler (only BURR for now) to support ↵Evan Cheng2007-09-251-71/+398
| | | | | | physical register dependency. The BURR scheduler can now backtrace and duplicate instructions in order to avoid "expensive / impossible to copy" values (e.g. status flag EFLAGS for x86) from being clobbered. llvm-svn: 42284
* Use struct SDep instead of std::pair for SUnit pred and succ lists. First stepEvan Cheng2007-09-191-22/+22
| | | | | | in tracking physical register output dependencies. llvm-svn: 42125
* Bug fixes.Evan Cheng2007-09-131-4/+4
| | | | llvm-svn: 41900
* Minor cleanups to reduce some spurious differences between differentDan Gohman2007-08-201-9/+11
| | | | | | scheduler implementations. llvm-svn: 41191
* Skeleton of post-RA scheduler; doesn't do anything yet.Dale Johannesen2007-07-131-1/+1
| | | | | | | Change name of -sched option and DEBUG_TYPE to pre-RA-sched; adjust testcases. llvm-svn: 39816
* Remove unused variables.David Greene2007-06-291-3/+0
| | | | llvm-svn: 37816
* Remove unnecessary attributions in comments.David Greene2007-06-291-1/+1
| | | | llvm-svn: 37799
* Remove the "special tie breaker" because it resulted in inconsistentDavid Greene2007-06-291-10/+12
| | | | | | | ordering and thus violated the strict weak ordering requirement of priority_queue. Uncovered by _GLIBCXX_DEBUG. llvm-svn: 37794
* std::set is really really terrible. Switch to SmallPtrSet to reduce compile ↵Evan Cheng2007-06-221-4/+4
| | | | | | time. For Duraid's example. The overall isel time is reduced from 0.6255 sec to 0.1876 sec. llvm-svn: 37701
* Fix a typo in a comment.Dan Gohman2007-04-261-1/+1
| | | | llvm-svn: 36485
* Estimate a cost using the possible number of scratch registers required and useEvan Cheng2007-03-141-9/+47
| | | | | | | | | | it as a late BURR scheduling tie-breaker. Intuitively, it's good to push down instructions whose results are liveout so their long live ranges won't conflict with other values which are needed inside the BB. Further prioritize liveout instructions by the number of operands which are calculated within the BB. llvm-svn: 35109
* Try schedule def + use closer whne Sethi-Ullman numbers are the same.Evan Cheng2007-03-131-6/+38
| | | | | | | | | | | | | | | | | | | | | e.g. t1 = op t2, c1 t3 = op t4, c2 and the following instructions are both ready. t2 = op c3 t4 = op c4 Then schedule t2 = op first. i.e. t4 = op c4 t2 = op c3 t1 = op t2, c1 t3 = op t4, c2 This creates more short live intervals which work better with the register allocator. llvm-svn: 35089
* switch the sched unit map over to use a DenseMap instead of std::map. ThisChris Lattner2007-02-031-5/+5
| | | | | | speeds up isel as a whole time by 2.6%. llvm-svn: 33810
* Fit in 80 columnsChris Lattner2007-02-011-5/+7
| | | | llvm-svn: 33745
* Naming consistency.Evan Cheng2007-01-081-25/+27
| | | | llvm-svn: 33026
* Fix for PR1075: bottom-up register-reduction scheduling actually increases ↵Evan Cheng2007-01-081-120/+72
| | | | | | | | | | register pressure. - Fixed bugs in sethi-ullman number computation and priority queue comparison functions. - Separate code that handles priority computation special cases from SU number computation. llvm-svn: 33025
* Removing even more <iostream> includes.Bill Wendling2006-12-071-16/+15
| | | | llvm-svn: 32320
* Match TargetInstrInfo changes.Evan Cheng2006-12-011-8/+4
| | | | llvm-svn: 32098
* Remove dead code; added a missing null ptr check.Evan Cheng2006-11-061-32/+1
| | | | llvm-svn: 31478
* Changes to use operand constraints to process two-address instructions.Evan Cheng2006-11-041-44/+128
| | | | llvm-svn: 31453
* silence warningChris Lattner2006-11-031-35/+0
| | | | llvm-svn: 31397
* For PR786:Reid Spencer2006-11-021-2/+0
| | | | | | | | | | Turn on -Wunused and -Wno-unused-parameter. Clean up most of the resulting fall out by removing unused variables. Remaining warnings have to do with unused functions (I didn't want to delete code without review) and unused variables in generated code. Maintainers should clean up the remaining issues when they see them. All changes pass DejaGnu tests and Olden. llvm-svn: 31380
* Clean up.Evan Cheng2006-11-011-5/+11
| | | | llvm-svn: 31359
* CopyFromReg starts a live range so its use should not be considered a floater.Evan Cheng2006-11-011-1/+1
| | | | llvm-svn: 31356
* Debug tweak.Evan Cheng2006-10-141-2/+2
| | | | llvm-svn: 30959
* s|llvm/Support/Visibility.h|llvm/Support/Compiler.h|Chris Lattner2006-08-271-1/+1
| | | | llvm-svn: 29911
* switch the SUnit pred/succ sets from being std::sets to being smallvectors.Chris Lattner2006-08-171-30/+30
| | | | | | | | This reduces selectiondag time on kc++ from 5.43s to 4.98s (9%). More significantly, this speeds up the default ppc scheduler from ~1571ms to 1063ms, a 33% speedup. llvm-svn: 29743
* Final polish on machine pass registries.Jim Laskey2006-08-021-1/+1
| | | | llvm-svn: 29471
* 1. Change use of "Cache" to "Default".Jim Laskey2006-08-011-2/+4
| | | | | | | | | | | 2. Added argument to instruction scheduler creators so the creators can do special things. 3. Repaired target hazard code. 4. Misc. More to follow. llvm-svn: 29450
* Introducing plugable register allocators and instruction schedulers.Jim Laskey2006-08-011-4/+14
| | | | llvm-svn: 29434
* Use an enumeration to eliminate data relocations.Jim Laskey2006-07-211-1/+1
| | | | llvm-svn: 29249
* Use hidden visibility to make symbols in an anonymous namespace getChris Lattner2006-06-281-2/+4
| | | | | | dropped. This shrinks libllvmgcc.dylib another 67K llvm-svn: 28975
* Shave another 27K off libllvmgcc.dylib with visibility hiddenChris Lattner2006-06-281-1/+2
| | | | llvm-svn: 28973
* Make sure the register pressure reduction schedulers work for non-uniformEvan Cheng2006-05-301-12/+14
| | | | | | latency targets, e.g. PPC32. llvm-svn: 28561
* Turn on -sched-commute-nodes by default.Evan Cheng2006-05-251-7/+2
| | | | llvm-svn: 28465
* Fixing 2006-05-01-SchedCausingSpills.ll; some clean upEvan Cheng2006-05-131-9/+63
| | | | llvm-svn: 28279
OpenPOWER on IntegriCloud