aboutsummaryrefslogtreecommitdiffstats
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* Remove the InstrSched directory (moved to SparcV9)Reid Spencer2004-10-101-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16887 91177308-0d34-0410-b5e6-96231b3b80d8
* Directory no long exists (moved to Targets/SparcV9).Reid Spencer2004-10-101-23/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16886 91177308-0d34-0410-b5e6-96231b3b80d8
* Initial version of automake Makefile.am file.Reid Spencer2004-10-1019-0/+427
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16885 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix assertion failure when calling or returning from a function whichBrian Gaeke2004-10-102-4/+4
| | | | | | | returns 'bool' type. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16884 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement eliminateCallFramePseudoInstr().Brian Gaeke2004-10-102-12/+16
| | | | | | | Wrap a long comment line. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16883 91177308-0d34-0410-b5e6-96231b3b80d8
* Model calls as *both* using *and* killing O0..O5, because callees use theBrian Gaeke2004-10-102-2/+4
| | | | | | | | argument values passed in (so they're not dead until *after* the call), and callees are free to modify those registers. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16882 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix whitespace and wrap some long lines.Brian Gaeke2004-10-102-16/+60
| | | | | | | | | Deal with allocating stack space for outgoing args and copying them into the correct stack slots (at least, we can copy <=32-bit int args). We now correctly generate ADJCALLSTACK* instructions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16881 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix 2004-10-10-CastStoreOnce.llx, by adjusting types back if we strip off a castChris Lattner2004-10-101-20/+23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16878 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement GlobalOpt/deadglobal-2.llx, deletion of globals that are onlyChris Lattner2004-10-101-0/+11
| | | | | | | | stored to, but are stored at variable indexes. This occurs at least in 176.gcc, but probably others, and we should handle it for completeness. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16876 91177308-0d34-0410-b5e6-96231b3b80d8
* Avoid calling use_size() which could (in theory) be expensive if the globalChris Lattner2004-10-101-12/+18
| | | | | | | | | | has a large number of users. Instead, just keep track of whether we're making changes as we do so. This patch has no functionlity changes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16874 91177308-0d34-0410-b5e6-96231b3b80d8
* bling bling!Chris Lattner2004-10-101-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16873 91177308-0d34-0410-b5e6-96231b3b80d8
* Eliminate global pointers that are only stored a single value and null ifChris Lattner2004-10-091-0/+103
| | | | | | | | | | | | | | | | | | | | | | we know that all uses of the global will trap if the pointer contained is null. In this case, we forward substitute the stored value to any uses. This has the effect of devirtualizing trivial globals in trivial cases. For example, 164.gzip contains this: gzip.h:extern int (*read_buf) OF((char *buf, unsigned size)); bits.c: read_buf = file_read; deflate.c: lookahead = read_buf((char*)window, deflate.c: n = read_buf((char*)window+strstart+lookahead, more); Since read_buf has to point to file_read at every use, we just replace the calls through read_buf with a direct call to file_read. This occurs in several benchmarks, including 176.gcc and 164.gzip. Direct calls are good and stuff. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16871 91177308-0d34-0410-b5e6-96231b3b80d8
* Instead of silently breaking, print notification of why this doesn't work.Chris Lattner2004-10-091-0/+9
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16870 91177308-0d34-0410-b5e6-96231b3b80d8
* Use DEBUG instead of DebugFlag directly, as DebugFlag does not respectChris Lattner2004-10-091-5/+3
| | | | | | | -debug-only! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16868 91177308-0d34-0410-b5e6-96231b3b80d8
* update according to tonight's infoBrian Gaeke2004-10-092-8/+10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16866 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement getModuleMatchQuality and getJITMatchQuality so that v8 will be theBrian Gaeke2004-10-094-0/+46
| | | | | | | | default 32/BE target on sparc hosts, and ppc will continue to be the default on other hosts. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16865 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix infinite loop due to iterationChris Lattner2004-10-091-1/+7
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16864 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement sub.ll:test17, -X/C -> X/-CChris Lattner2004-10-091-0/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16863 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a check to avoid an assertion on malformed inputChris Lattner2004-10-091-0/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16861 91177308-0d34-0410-b5e6-96231b3b80d8
* The person who was planning to add SSE support isn't anymore, so disableChris Lattner2004-10-081-1/+3
| | | | | | | | | | the -sse* options (to avoid misleading people). Also, the stack alignment of the target doesn't depend on whether SSE is eventually implemented, so remove a comment. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16860 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a major regression from the bugfix for 2004-10-08-SelectSetCCFold.llx,Chris Lattner2004-10-081-1/+1
| | | | | | | | | which prevented setcc's from being folded into branches. It appears that conditional branchinst's CC operand is actually operand(2), not operand(0) as we might expect. :( git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16859 91177308-0d34-0410-b5e6-96231b3b80d8
* If we found a dead global, we should at least delete it...Chris Lattner2004-10-081-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16858 91177308-0d34-0410-b5e6-96231b3b80d8
* * Pull out the meat of runOnModule into another function for clarity.Chris Lattner2004-10-081-45/+101
| | | | | | | | | | | * Do not lead dangling dead constants prevent optimization * Iterate global optimization while we're making progress. These changes allow us to be more aggressive, handling cases like GlobalOpt/iterate.llx without a problem (turning it into 'ret int 0'). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16857 91177308-0d34-0410-b5e6-96231b3b80d8
* We might as well delete the known-dead global sooner rather than later sinceChris Lattner2004-10-081-0/+2
| | | | | | | we know it is dead. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16855 91177308-0d34-0410-b5e6-96231b3b80d8
* Hyphenate target-(in)dependent for more tasty grammar goodness (tm)Misha Brukman2004-10-081-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16854 91177308-0d34-0410-b5e6-96231b3b80d8
* Temporarily disable a buggy transformation until it can be fixed. This fixesChris Lattner2004-10-081-0/+5
| | | | | | | 254.gap. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16853 91177308-0d34-0410-b5e6-96231b3b80d8
* Adjust paths due to moving InstrSched to lib/Target/SparcV9Misha Brukman2004-10-083-7/+7
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16852 91177308-0d34-0410-b5e6-96231b3b80d8
* InstrSched has been moved to lib/Target/SparcV9Misha Brukman2004-10-081-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16850 91177308-0d34-0410-b5e6-96231b3b80d8
* InstrSched is SparcV9-specific and so has been moved to lib/Target/SparcV9/Misha Brukman2004-10-087-3197/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16849 91177308-0d34-0410-b5e6-96231b3b80d8
* Single-space instead of double-spacing in the MakefileMisha Brukman2004-10-081-3/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16848 91177308-0d34-0410-b5e6-96231b3b80d8
* Build InstrSched as well, and all three subdirs can be built independentlyMisha Brukman2004-10-081-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16847 91177308-0d34-0410-b5e6-96231b3b80d8
* * Adjust for the move to lib/Target/SparcV9/InstrSchedMisha Brukman2004-10-081-2/+2
| | | | | | | * Rename library to mark it SparcV9-specific git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16846 91177308-0d34-0410-b5e6-96231b3b80d8
* Single-space instead of double-spacing in the MakefileMisha Brukman2004-10-082-4/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16845 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement SRA for global variables. This allows the other global variableChris Lattner2004-10-081-32/+137
| | | | | | | | | | | | optimizations to trigger much more often. This allows the elimination of several dozen more global variables in Programs/External. Note that we only do this for non-constant globals: constant globals will already be optimized out if the accesses to them permit it. This implements Transforms/GlobalOpt/globalsra.llx git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16842 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix bug: 2004-10-08-SelectSetCCFold.llx. Normally this is hidden by theChris Lattner2004-10-081-1/+2
| | | | | | | instcombine xform, which is why we didn't notice it before. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16840 91177308-0d34-0410-b5e6-96231b3b80d8
* Instcombine (X & FF00) + xx00 -> (X+xx00) & FF00, implementing and.ll:test27Chris Lattner2004-10-081-0/+25
| | | | | | | This comes up when doing adds to bitfield elements. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16836 91177308-0d34-0410-b5e6-96231b3b80d8
* Little patch to turn (shl (add X, 123), 4) -> (add (shl X, 4), 123 << 4)Chris Lattner2004-10-081-0/+3
| | | | | | | | This triggers in cases of bitfield additions, opening opportunities for future improvements. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16834 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement logical and with an immediate that consists of a contiguous blockNate Begeman2004-10-081-5/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | of one or more 1 bits (may wrap from least significant bit to most significant bit) as the rlwinm rather than andi., andis., or some longer instructons sequence. int andn4(int z) { return z & -4; } int clearhi(int z) { return z & 0x0000FFFF; } int clearlo(int z) { return z & 0xFFFF0000; } int clearmid(int z) { return z & 0x00FFFF00; } int clearwrap(int z) { return z & 0xFF0000FF; } _andn4: rlwinm r3, r3, 0, 0, 29 blr _clearhi: rlwinm r3, r3, 0, 16, 31 blr _clearlo: rlwinm r3, r3, 0, 0, 15 blr _clearmid: rlwinm r3, r3, 0, 8, 23 blr _clearwrap: rlwinm r3, r3, 0, 24, 7 blr git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16832 91177308-0d34-0410-b5e6-96231b3b80d8
* Several fixes and enhancements to the PPC32 backend.Nate Begeman2004-10-073-147/+154
| | | | | | | | | | | | | | | | | | | | | | | 1. Fix an illegal argument to getClassB when deciding whether or not to sign extend a byte load. 2. Initial addition of isLoad and isStore flags to the instruction .td file for eventual use in a scheduler. 3. Rewrite of how constants are handled in emitSimpleBinaryOperation so that we can emit the PowerPC shifted immediate instructions far more often. This allows us to emit the following code: int foo(int x) { return x | 0x00F0000; } _foo: .LBB_foo_0: ; entry ; IMPLICIT_DEF oris r3, r3, 15 blr git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16826 91177308-0d34-0410-b5e6-96231b3b80d8
* Add ori reg, reg, 0 as a move instruction. This can be generated fromNate Begeman2004-10-071-0/+11
| | | | | | | | | | | | | | | | | | loading a 32bit constant into a register whose low halfword is all zeroes. We now omit the ori after the lis for the following C code: int bar(int y) { return y * 0x00F0000; } _bar: .LBB_bar_0: ; entry ; IMPLICIT_DEF lis r2, 15 mullw r3, r3, r2 blr git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16825 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unnecessary header includeNate Begeman2004-10-071-1/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16824 91177308-0d34-0410-b5e6-96231b3b80d8
* Improve comments, no functionality changesChris Lattner2004-10-071-18/+53
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16814 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a nasty dangling pointer problem, due to a free'd pointer being left inChris Lattner2004-10-071-0/+3
| | | | | | | | a map. This caused problems if a later object happened to be allocated at the free'd object's address. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16813 91177308-0d34-0410-b5e6-96231b3b80d8
* Unfortunately the fix for the previous bug introduced the previousChris Lattner2004-10-071-41/+67
| | | | | | | | | | | exponential behavior (bork!). This patch processes stuff with an explicit SCC finder, allowing the algorithm to be more clear, efficient, and also (as a bonus) correct! This gets us back to taking 0.6s to disassemble my horrible .bc file that previously took something > 30 mins. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16811 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a bug in my previous change. Unfortunately this reverts most of theChris Lattner2004-10-071-3/+4
| | | | | | | speedup, but has the advantage of not breaking a bunch of programs! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16806 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a bug in the safety analysis routineChris Lattner2004-10-071-3/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16804 91177308-0d34-0410-b5e6-96231b3b80d8
* Comment cleanupsChris Lattner2004-10-071-4/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16803 91177308-0d34-0410-b5e6-96231b3b80d8
* * Rename pass to globalopt, since we do more than just constifyChris Lattner2004-10-071-81/+184
| | | | | | | | | | | | | | | | | * Instead of handling dead functions specially, just nuke them. * Be more aggressive about cleaning up after constification, in particular, handle getelementptr instructions and constantexprs. * Be a little bit more structured about how we process globals. *** Delete globals that are only stored to, and never read. These are clearly not useful, so they should go. This implements deadglobal.llx This last one triggers quite a few times. In particular, 2208 in the external tests, 1865 of which are in 252.eon. This shrinks eon from 1995094 to 1732341 bytes of bytecode. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16802 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement GlobalConstifier/trivialstore.llx, and also do someChris Lattner2004-10-061-3/+52
| | | | | | | | | | | | | | | | | | | | | | | | | simplifications of the resultant program to avoid making later passes do it all. This allows us to constify globals that just have the same constant that they are initialized stored into them. Suprisingly this comes up ALL of the freaking time, dozens of times in SPEC, 30 times in vortex alone. For example, on 256.bzip2, it allows us to constify these two globals: %smallMode = internal global ubyte 0 ; <ubyte*> [#uses=8] %verbosity = internal global int 0 ; <int*> [#uses=49] Which (with later optimizations) results in the bytecode file shrinking from 82286 to 69686 bytes! Lets hear it for IPO :) For the record, it's nuking lots of "if (verbosity > 2) { do lots of stuff }" code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16793 91177308-0d34-0410-b5e6-96231b3b80d8
* Dont' let null nodes sneak past cast instructionsChris Lattner2004-10-061-1/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16779 91177308-0d34-0410-b5e6-96231b3b80d8