aboutsummaryrefslogtreecommitdiffstats
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* Implement folding explicit load instructions into binary operations. For aChris Lattner2004-03-082-0/+162
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | testcase like this: int %test(int* %P, int %A) { %Pv = load int* %P %B = add int %A, %Pv ret int %B } We now generate: test: mov %ECX, DWORD PTR [%ESP + 4] mov %EAX, DWORD PTR [%ESP + 8] add %EAX, DWORD PTR [%ECX] ret Instead of: test: mov %EAX, DWORD PTR [%ESP + 4] mov %ECX, DWORD PTR [%ESP + 8] mov %EAX, DWORD PTR [%EAX] add %EAX, %ECX ret ... saving one instruction, and often a register. Note that there are a lot of other instructions that could use this, but they aren't handled. I'm not really interested in adding them, but mul/div and all of the FP instructions could be supported as well if someone wanted to add them. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12204 91177308-0d34-0410-b5e6-96231b3b80d8
* Rearrange and refactor some code. No functionality changes.Chris Lattner2004-03-082-202/+192
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12203 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement ArgumentPromotion/aggregate-promote.llChris Lattner2004-03-081-25/+145
| | | | | | | | | | | | | | | | | | | This allows pointers to aggregate objects, whose elements are only read, to be promoted and passed in by element instead of by reference. This can enable a LOT of subsequent optimizations in the caller function. It's worth pointing out that this stuff happens a LOT of C++ programs, because objects in templates are generally passed around by reference. When these templates are instantiated on small aggregate or scalar types, however, it is more efficient to pass them in by value than by reference. This transformation triggers most on C++ codes (e.g. 334 times on eon), but does happen on C codes as well. For example, on mesa it triggers 72 times, and on gcc it triggers 35 times. this is amazingly good considering that we are using 'basicaa' so far. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12202 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement: ArgumentPromotion/chained.llChris Lattner2004-03-071-0/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12200 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix another minor bug, exposed by perlbmkChris Lattner2004-03-071-3/+11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12198 91177308-0d34-0410-b5e6-96231b3b80d8
* Since 'load null' is undefined, we can make it do whatever we want. ReturningChris Lattner2004-03-071-0/+6
| | | | | | | a zero value is the most likely way to cause further simplification, so we do it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12197 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a minor bug and turn debug output into, well, debug output.Chris Lattner2004-03-071-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12195 91177308-0d34-0410-b5e6-96231b3b80d8
* New LLVM pass: argument promotion. This version only handles simple scalarChris Lattner2004-03-071-0/+328
| | | | | | | variables. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12193 91177308-0d34-0410-b5e6-96231b3b80d8
* Add memory operand version of conditional move.Alkis Evlogimenos2004-03-072-3/+10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12190 91177308-0d34-0410-b5e6-96231b3b80d8
* As I wrote in the docs, simple is the default spiller :-)Alkis Evlogimenos2004-03-061-2/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12189 91177308-0d34-0410-b5e6-96231b3b80d8
* Add simple spiller.Alkis Evlogimenos2004-03-061-9/+72
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12188 91177308-0d34-0410-b5e6-96231b3b80d8
* Support return values of basic integer types.Brian Gaeke2004-03-064-96/+148
| | | | | | | | Emit RETL instruction to return instead of funny JMPL. Fix indentation. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12186 91177308-0d34-0410-b5e6-96231b3b80d8
* Sort stanzas into Sparc V8 book page number order.Brian Gaeke2004-03-062-34/+46
| | | | | | | Add RET, RETL. Rename SAVE, RESTORE & JMPL for consistency. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12185 91177308-0d34-0410-b5e6-96231b3b80d8
* Hack it so we do not try to allocate values to G0.Brian Gaeke2004-03-062-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12184 91177308-0d34-0410-b5e6-96231b3b80d8
* Make prolog align stack properly. Make epilog not touch any registers.Brian Gaeke2004-03-062-8/+8
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12183 91177308-0d34-0410-b5e6-96231b3b80d8
* Emit register names in lowercase, as required by the assembler.Brian Gaeke2004-03-062-2/+22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12182 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach getRegClassForType where to find FP registersBrian Gaeke2004-03-062-6/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12180 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a minor bugChris Lattner2004-03-051-1/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12169 91177308-0d34-0410-b5e6-96231b3b80d8
* Unbreak the build on Sparc.Misha Brukman2004-03-051-0/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12161 91177308-0d34-0410-b5e6-96231b3b80d8
* Asm output is looking a lot better; not correct for all operands yet though.Brian Gaeke2004-03-052-2/+124
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12143 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a bug in a previous checkin that broke 175.vprChris Lattner2004-03-041-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12128 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for strto* and v*printfChris Lattner2004-03-041-0/+66
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12127 91177308-0d34-0410-b5e6-96231b3b80d8
* Add non-crappy support for varargsChris Lattner2004-03-041-6/+32
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12126 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement a FIXME, improving the efficiency of DSA on povray.Chris Lattner2004-03-041-2/+16
| | | | | | | | This reduces CBU time from 145s -> 122s (debug build), reduces # allocated nodes from 129420 to 116477. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12125 91177308-0d34-0410-b5e6-96231b3b80d8
* Support -print-machineinstrsBrian Gaeke2004-03-042-12/+18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12124 91177308-0d34-0410-b5e6-96231b3b80d8
* Speed up the cbu pass from taking somewhere near the age of the universe to ↵Chris Lattner2004-03-041-6/+28
| | | | | | about 90s on povray git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12123 91177308-0d34-0410-b5e6-96231b3b80d8
* make -print-machineinstrs work for both SparcV9 and X86Brian Gaeke2004-03-043-10/+26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12122 91177308-0d34-0410-b5e6-96231b3b80d8
* Add assertion for scale verification.Alkis Evlogimenos2004-03-041-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12120 91177308-0d34-0410-b5e6-96231b3b80d8
* Hide variable from other functions.Alkis Evlogimenos2004-03-041-2/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12118 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix BU datastructures with povray!Chris Lattner2004-03-041-11/+25
| | | | | | | | | The problem was that we were merging a field of a node with a value that was deleted. Thanks to bugpoint for reducing povray to a nice small 3 function example. :) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12116 91177308-0d34-0410-b5e6-96231b3b80d8
* Minor changes, remove some debugging code that got checked in somehow.Chris Lattner2004-03-041-7/+10
| | | | | | | | Make sure to scope the NodeMap passed into cloneInto so that it doesn't point to nodes that are deleted. Add some FIXME's for future performance enhancements. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12115 91177308-0d34-0410-b5e6-96231b3b80d8
* Asm printer support, based on x86 - only prints mnemonics for nowBrian Gaeke2004-03-046-4/+924
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12113 91177308-0d34-0410-b5e6-96231b3b80d8
* Double-FP pseudo-registers.Brian Gaeke2004-03-042-6/+72
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12112 91177308-0d34-0410-b5e6-96231b3b80d8
* Subtract instructions; minor cleanupsBrian Gaeke2004-03-046-18/+32
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12111 91177308-0d34-0410-b5e6-96231b3b80d8
* Floating point regsBrian Gaeke2004-03-042-4/+34
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12110 91177308-0d34-0410-b5e6-96231b3b80d8
* Only clone nodes that are needed in the caller, don't clone ALL aux calls. ↵Chris Lattner2004-03-041-20/+48
| | | | | | | | | This improves povray from having ~600K nodes and 300K call nodes to 65K nodes and 25K call nodes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12109 91177308-0d34-0410-b5e6-96231b3b80d8
* Simple copyConstantToReg support, SETHIi and ORriBrian Gaeke2004-03-046-16/+88
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12107 91177308-0d34-0410-b5e6-96231b3b80d8
* Support add - note, still missing important copyConstantToRegister stuffBrian Gaeke2004-03-036-10/+614
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12106 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a minor bug handling incomplete programsChris Lattner2004-03-031-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12105 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a DSA bug that caused DSA to generate incredibly huge graphs and take ↵Chris Lattner2004-03-031-1/+34
| | | | | | | | | | | forever to do it on povray. The problem is that we were not copying globals from callees to callers unless the existed in both graphs. We should have copied them in the case where the global pointed to a node that was copied as well. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12104 91177308-0d34-0410-b5e6-96231b3b80d8
* Deinline methods, add fast exitChris Lattner2004-03-031-0/+27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12102 91177308-0d34-0410-b5e6-96231b3b80d8
* Make MachineOperand's value named 'contents'. Make really, really sureBrian Gaeke2004-03-031-6/+6
| | | | | | | | it is always completely initialized and copied. Also, fix up many comments and asserts. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12100 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a node mapping problem that was causing the pool allocator to locally ↵Chris Lattner2004-03-031-0/+3
| | | | | | | | | allocate nodes that were globally live, thus breaking programs. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12094 91177308-0d34-0410-b5e6-96231b3b80d8
* SPECIFY a target data to initialize the CBE target with. Until now we haveChris Lattner2004-03-031-1/+1
| | | | | | | | | been using the default target data layout object to lower malloc instructions, causing us to allocate more memory than we needed! This could improve the performance of the CBE generated code substantially! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12088 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a new constructorChris Lattner2004-03-031-0/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12087 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't emit things like malloc(16*1). Allocation instructions are fixed ↵Chris Lattner2004-03-031-1/+1
| | | | | | arity now. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12086 91177308-0d34-0410-b5e6-96231b3b80d8
* FINALLY be able to get symbolic type names in the globals graph!Chris Lattner2004-03-021-1/+14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12082 91177308-0d34-0410-b5e6-96231b3b80d8
* Really, only if reopenChris Lattner2004-03-021-1/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12080 91177308-0d34-0410-b5e6-96231b3b80d8
* Doxygenify comments.Misha Brukman2004-03-022-50/+46
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12071 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement ExtractCodeRegion()Misha Brukman2004-03-021-1/+9
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12070 91177308-0d34-0410-b5e6-96231b3b80d8