aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen
Commit message (Collapse)AuthorAgeFilesLines
* * Fix incorrect computation of the runOnMachineFunction return valueChris Lattner2004-01-311-30/+23
| | | | | | | * Turn a bunch of instance variables into automatic variables git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11035 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unneeded #includesChris Lattner2004-01-311-12/+10
| | | | | | | | | Move Passes.h (which defines the interface to this file) to the top. Move statistics to the top of the file. Add a comment git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11034 91177308-0d34-0410-b5e6-96231b3b80d8
* Merge safe parts from last night's buggy commit. These do not breakAlkis Evlogimenos2004-01-312-67/+78
| | | | | | | any test cases :-) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11032 91177308-0d34-0410-b5e6-96231b3b80d8
* Optimize liveAt() and overlaps(). We now use a binary search insteadAlkis Evlogimenos2004-01-311-20/+30
| | | | | | | | | of a linear search to find the first range for comparisons. This cuts down the linear scan register allocator running time by a factor of 3 in 254.perlbmk and by a factor of 2.2 in 176.gcc. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11030 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert last night's changes as they broke some tests. Will remerge parts of ↵Alkis Evlogimenos2004-01-312-115/+115
| | | | | | the patch. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11029 91177308-0d34-0410-b5e6-96231b3b80d8
* Several performance enhancements and cleanups from Chris.Alkis Evlogimenos2004-01-312-115/+115
| | | | | | | | Simplification of LiveIntervals::Interval::overlaps() and addition of examples to overlaps() and liveAt() to make them clearer. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11028 91177308-0d34-0410-b5e6-96231b3b80d8
* Finegrainify namespacificationChris Lattner2004-01-301-4/+17
| | | | | | | Implement LiveVariables::getIndexMachineBasicBlock git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11018 91177308-0d34-0410-b5e6-96231b3b80d8
* Give clients of MachineFunctionPrinter the ability to specify a banner andBrian Gaeke2004-01-301-3/+14
| | | | | | | choose an ostream. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11016 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix failing test cases with joined live intervals. It turns out thatAlkis Evlogimenos2004-01-232-3/+26
| | | | | | | | | | when joining we need to check if we overlap with the second interval or any of its aliases. Also make joining intervals the default. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10973 91177308-0d34-0410-b5e6-96231b3b80d8
* Add option to join live intervals. Two intervals are joined if thereAlkis Evlogimenos2004-01-223-48/+252
| | | | | | | | | | | | | | | is a move between two registers, at least one of the registers is virtual and the two live intervals do not overlap. This results in about 40% reduction in intervals, 30% decrease in the register allocators running time and a 20% increase in peephole optimizations (mainly move eliminations). The option can be enabled by passing -join-liveintervals where appropriate. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10965 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unneeded check. An interval in active, by definition overlapsAlkis Evlogimenos2004-01-221-4/+1
| | | | | | | with the current one. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10959 91177308-0d34-0410-b5e6-96231b3b80d8
* Improve debugging output. Remove unneeded virtReg->0 mapping whenAlkis Evlogimenos2004-01-221-20/+31
| | | | | | | | | virtReg lives on the stack. Now a virtual register has an entry in the virtual->physical map or the virtual->stack slot map but never in both. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10958 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert previous change. The code was correct...Alkis Evlogimenos2004-01-221-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10957 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix incorrect negatives in LiveIntervals::Interval::liveAt().Alkis Evlogimenos2004-01-221-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10956 91177308-0d34-0410-b5e6-96231b3b80d8
* Moved iterators around.Tanya Lattner2004-01-201-2/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10926 91177308-0d34-0410-b5e6-96231b3b80d8
* Moved iterators to common file.Tanya Lattner2004-01-201-62/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10925 91177308-0d34-0410-b5e6-96231b3b80d8
* Handle printing of intervals that are not assign to any physicalAlkis Evlogimenos2004-01-161-1/+1
| | | | | | | register yet (2nd try). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10896 91177308-0d34-0410-b5e6-96231b3b80d8
* Handle printing of intervals that are not assign to any physicalAlkis Evlogimenos2004-01-161-6/+7
| | | | | | | register yet. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10895 91177308-0d34-0410-b5e6-96231b3b80d8
* Fold open interval ends handling intoAlkis Evlogimenos2004-01-162-11/+5
| | | | | | | LiveIntervals::Interval::expiredAt() and simplify regalloc code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10894 91177308-0d34-0410-b5e6-96231b3b80d8
* Add asserts to previous change.Alkis Evlogimenos2004-01-161-2/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10893 91177308-0d34-0410-b5e6-96231b3b80d8
* Use a list instead of a vector to store intervals. This will be neededAlkis Evlogimenos2004-01-162-9/+9
| | | | | | | when we join intervals and one of the two will need to be removed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10892 91177308-0d34-0410-b5e6-96231b3b80d8
* Hrm, apparently I missed lowering this intrinsic. :(Chris Lattner2004-01-141-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10858 91177308-0d34-0410-b5e6-96231b3b80d8
* Properly update #intervals statistic.Alkis Evlogimenos2004-01-141-0/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10847 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix bug in LiveIntervals::Interval::overlaps andAlkis Evlogimenos2004-01-141-3/+3
| | | | | | | | LiveIntervals::Interval::liveAt. Both were considering the live ranges closed in the end, when they are actually open. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10835 91177308-0d34-0410-b5e6-96231b3b80d8
* Improve debugging output.Alkis Evlogimenos2004-01-141-2/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10834 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix miscomputation of live intervals. The catch is that registers canAlkis Evlogimenos2004-01-131-0/+17
| | | | | | | | be dead at the defining instruction but can only be killed in subsequent ones. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10833 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove allocatable registers vector. It is already provided byAlkis Evlogimenos2004-01-132-23/+2
| | | | | | | LiveVariables. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10830 91177308-0d34-0410-b5e6-96231b3b80d8
* Cleanup debugging output.Alkis Evlogimenos2004-01-131-9/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10824 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix output of live intervals to show correctly its closed, openAlkis Evlogimenos2004-01-131-1/+1
| | | | | | | ranges, i.e. [a,b) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10822 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unneeded check (with the recent change in live variables a useAlkis Evlogimenos2004-01-131-4/+2
| | | | | | | of a physical register is always dominated by a def). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10821 91177308-0d34-0410-b5e6-96231b3b80d8
* Indentation and whitespace cleanups.Alkis Evlogimenos2004-01-131-9/+9
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10820 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix bug introduced by previous commit: check if fixed intervalsAlkis Evlogimenos2004-01-131-0/+3
| | | | | | | overlap before adding their spill weight. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10819 91177308-0d34-0410-b5e6-96231b3b80d8
* Correctly compute live variable information for physical registersAlkis Evlogimenos2004-01-133-33/+30
| | | | | | | | | | | | | | | when an implicitely defined register is later used by an alias. For example: call foo %reg1024 = mov %AL The call implicitely defines EAX but only AL is used. Before this fix no information was available on AL. Now EAX and all its aliases except AL get defined and die at the call instruction whereas AL lives to be killed by the assignment. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10813 91177308-0d34-0410-b5e6-96231b3b80d8
* Make LiveVariables::HandlePhysRegUse andAlkis Evlogimenos2004-01-111-21/+11
| | | | | | | | | | LiveVariables::HandlePhysRegDef private they use information that is not in memory when LiveVariables finishes the analysis. Also update the TwoAddressInstructionPass to not use this interface. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10755 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove use of llvm/CodeGen/InstrSelection.hChris Lattner2004-01-101-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10749 91177308-0d34-0410-b5e6-96231b3b80d8
* Finegrainify namespacification.Chris Lattner2004-01-091-9/+4
| | | | | | | | | This should get hunked over to the Sparc backend, along with MachineCodeForInstruction and a bunch of files in include/llvm/Codegen, but those battles will have to wait for a later time. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10731 91177308-0d34-0410-b5e6-96231b3b80d8
* Move InstrSelection into lib/Target/Sparc, as it's sparc specificChris Lattner2004-01-095-1038/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10730 91177308-0d34-0410-b5e6-96231b3b80d8
* Move lib/Codegen/RegAlloc into lib/Target/Sparc, as it is sparc specificChris Lattner2004-01-0915-3354/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10728 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a separate list of fixed intervals. This improves the running timeAlkis Evlogimenos2004-01-071-64/+111
| | | | | | | | | | | | | | | | | | | of the register allocator as follows: before after mesa 2.3790 1.5994 vpr 2.6008 1.2078 gcc 1.9840 0.5273 mcf 0.2569 0.0470 eon 1.8468 1.4359 twolf 0.9475 0.2004 burg 1.6807 1.3300 lambda 1.2191 0.3764 Speedups range anyware from 30% to over 400% :-) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10712 91177308-0d34-0410-b5e6-96231b3b80d8
* Minor cleanups.Alkis Evlogimenos2004-01-071-29/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10711 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove declared but undefined method.Alkis Evlogimenos2004-01-071-5/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10710 91177308-0d34-0410-b5e6-96231b3b80d8
* Change implementation of LiveIntervals::overlap(). This results in aAlkis Evlogimenos2004-01-071-10/+22
| | | | | | | 30-50% decrease in running time of the linear scan register allocator. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10707 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove simple coalescing.Alkis Evlogimenos2004-01-052-26/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10695 91177308-0d34-0410-b5e6-96231b3b80d8
* fix warningChris Lattner2004-01-051-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10692 91177308-0d34-0410-b5e6-96231b3b80d8
* Add VMCore and code generator support for debugging intrinsics. By defaultChris Lattner2004-01-051-0/+8
| | | | | | | code generators completely ignore them. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10691 91177308-0d34-0410-b5e6-96231b3b80d8
* Currently we cannot handle two-address instructions of the form:Alkis Evlogimenos2004-01-051-0/+9
| | | | | | | | A = B op C where A == C, but this cannot really occur in practice because of SSA form. Add an assert to check that just to be safe. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10682 91177308-0d34-0410-b5e6-96231b3b80d8
* Update description.Alkis Evlogimenos2004-01-041-5/+10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10681 91177308-0d34-0410-b5e6-96231b3b80d8
* Clean up a lot of the code I added yesterday by exposing the IntrinsicLoweringChris Lattner2003-12-282-9/+4
| | | | | | | implementation from the TargetMachine directly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10636 91177308-0d34-0410-b5e6-96231b3b80d8
* Reserve ECX and EDI instead of EBX and EDI. Since EBX is a calleeAlkis Evlogimenos2003-12-281-8/+8
| | | | | | | | | saved register it has a longer free range than ECX (which is defined every time there is a fnuction call) which makes ECX a better register to reserve. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10635 91177308-0d34-0410-b5e6-96231b3b80d8
* Add coalescing to register allocator. A hint is added to each intervalAlkis Evlogimenos2003-12-283-2/+30
| | | | | | | | | | | | which denotes the register we would like to be assigned to (virtual or physical). In register allocation, if this hint exists and we can map it to a physical register (it is either a physical register or it is a virtual register that already got assigned to a physical one) we use that register if it is available instead of a random one in the free pool. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10634 91177308-0d34-0410-b5e6-96231b3b80d8