summaryrefslogtreecommitdiffstats
path: root/llvm/lib
Commit message (Collapse)AuthorAgeFilesLines
* Complete rewrite of this pass to be faster, use less memory, be easier toChris Lattner2004-07-271-97/+148
| | | | | | | understand, and more accurate to boot! This implements GlobalModRef/purecse.ll over the previous impl. llvm-svn: 15260
* Simplify code and silence warningChris Lattner2004-07-271-6/+4
| | | | llvm-svn: 15255
* Use context-sensitive alias analysis to avoid pessimization in clients ofChris Lattner2004-07-271-5/+23
| | | | | | | AliasSetTracker (dse and licm). This implements DeadStoreElimination/context-sensitive.llx llvm-svn: 15254
* Make basicaa a bit more aggressiveChris Lattner2004-07-271-0/+4
| | | | llvm-svn: 15252
* basic-aa can actually provide simple mod/ref infoChris Lattner2004-07-271-3/+3
| | | | llvm-svn: 15251
* This was implemented back in marchChris Lattner2004-07-271-7/+0
| | | | llvm-svn: 15250
* Do not store the stack pointer if the stack size is 0.Misha Brukman2004-07-261-8/+14
| | | | | | Also, convert C-style comments to C++ and make sure code wraps at 80 cols. llvm-svn: 15245
* ADDI can take several forms, including:Misha Brukman2004-07-261-2/+1
| | | | | | | | | | addi r1, r2, 0 addi r1, <frame index #n>, 0 so we must check for the second parameter being a register for this instruction to be considered a reg-to-reg copy. llvm-svn: 15244
* assert() on MachineInstr properties instead of checking them dynamicallyMisha Brukman2004-07-261-7/+8
| | | | llvm-svn: 15243
* * Recognize `addi r1, r2, 0' a move instructionMisha Brukman2004-07-261-2/+12
| | | | | | * List formats of instructions currently recognized as moves llvm-svn: 15242
* Fix indentation: should be 2 spaces.Misha Brukman2004-07-261-25/+25
| | | | llvm-svn: 15240
* Fix file header as it has been renamed.Misha Brukman2004-07-265-5/+5
| | | | llvm-svn: 15239
* Renamed files to have the `X86' prefix for uniqueness purposes.Misha Brukman2004-07-265-0/+0
| | | | | | All CVS history was renamed, the *,v were copied over. No worries. llvm-svn: 15238
* * Rewrote castsMisha Brukman2004-07-262-384/+1020
| | | | | | | | | | * Implemented GEP folding * Dynamically output global address stuff once per function * Fix casting fp<->short/byte Patch contributed by Nate Begeman. llvm-svn: 15237
* Increment the label number in runOnFunction() rather than while printing outMisha Brukman2004-07-262-22/+20
| | | | | | some instruction. Patch by Nate Begeman. llvm-svn: 15236
* More notes on bugs, unimplemented features, and suggested code improvements.Misha Brukman2004-07-261-14/+19
| | | | | | Written by Nate Begeman. llvm-svn: 15235
* Fix subtracting values > 2^15 in the prologue/epilogue, by Nate Begeman.Misha Brukman2004-07-261-4/+20
| | | | llvm-svn: 15234
* Implement DeadStoreElim/alloca.llx by observing that allocas are dead at theChris Lattner2004-07-261-1/+4
| | | | | | end of the function (either return or unwind) llvm-svn: 15232
* Add some new methodsChris Lattner2004-07-261-0/+13
| | | | llvm-svn: 15230
* Throttle back indvar substitution from creating multiplies in loops. This ↵Chris Lattner2004-07-261-3/+3
| | | | | | is bad bad bad. llvm-svn: 15227
* Fix bug in previous patch :(Chris Lattner2004-07-261-6/+12
| | | | llvm-svn: 15226
* Fix an extremely serious regression that was causing LLVM basic blocks to beChris Lattner2004-07-261-0/+6
| | | | | | scrambled around almost at random, having really bad effects on icache locality. llvm-svn: 15225
* Fix a serious bug in the double constant reader. In particular, becauseChris Lattner2004-07-251-1/+2
| | | | | | | | (At[3] << 24) is an int type and it is being coerced to uint64_t, it was getting sign extended, causing us to get FFFFFFFFxxxxxxxx constants all of the time. llvm-svn: 15224
* Temporarily disable this code, as it is emitting LLVM_NAN("nan") which ↵Chris Lattner2004-07-251-2/+2
| | | | | | | | | | | results in a call to the glibc 'nan' function because the initializer is not a string. This breaks when used in a global initializer. Try compiling this testcase for example: %X = global float <some nan value> llvm-svn: 15223
* Avoid use of size(), which counts, in favor of other mechanisms.Reid Spencer2004-07-251-4/+5
| | | | llvm-svn: 15221
* Always write FP values correctly.Reid Spencer2004-07-251-35/+21
| | | | | | | Adjust for new Module.h interface for dependent libraries. Excise unused backwards compatibility flag. llvm-svn: 15220
* Don't create a backwards compatibility flag for something that was aReid Spencer2004-07-251-4/+0
| | | | | | regression bug introduced in release 1.2 llvm-svn: 15219
* Adjust to new Module.h interface for dependent libraries.Reid Spencer2004-07-251-2/+2
| | | | llvm-svn: 15218
* Adjust to new Module.h interface for dependent librariesReid Spencer2004-07-251-8/+7
| | | | | | Remove mem leaks resulting from not freeing parse strings. llvm-svn: 15217
* Adjust to new Module.h interface for dependent librariesReid Spencer2004-07-251-8/+12
| | | | | | Only write the target triple and deplibs if they are non-empty. llvm-svn: 15216
* Fix a latent bug in the AliasSetTracker that was exposed by the FreeInst ↵Chris Lattner2004-07-251-1/+2
| | | | | | additions and broke a bunch of programs last night. llvm-svn: 15214
* bug 263:Reid Spencer2004-07-251-0/+1
| | | | | | Ensure the list of libraries is cleared. llvm-svn: 15212
* bug 263:Reid Spencer2004-07-251-0/+11
| | | | | | Add ability to write target triple and dependent libraries information. llvm-svn: 15211
* bug 263:Reid Spencer2004-07-257-811/+1003
| | | | | | | | | | | | | | | | - encode/decode target triple and dependent libraries bug 401: - fix encoding/decoding of FP values to be little-endian only bug 402: - initial (compatible) cut at 24-bit types instead of 32-bit - reduce size of block headers by 50% Other: - cleanup Writer by consolidating to one compilation unit, rem. other files - use a std::vector instead of std::deque so the buffer can be allocated in multiples of 64KByte chunks rather than in multiples of some smaller (default) number. llvm-svn: 15210
* bug 263:Reid Spencer2004-07-251-1/+22
| | | | | | Provide parsing for the target triple and dependent libraries. llvm-svn: 15209
* bug 263:Reid Spencer2004-07-251-0/+2
| | | | | | Provide new tokens for target triples and dependent libraries. llvm-svn: 15208
* * Substantially simplify how free instructions are handled (potentially fixingChris Lattner2004-07-251-43/+52
| | | | | | | | | | | a bug in DSE). * Delete dead operand uses iteratively instead of recursively, using a SetVector. * Defer deletion of dead operand uses until the end of processing, which means we don't have to bother with updating the AliasSetTracker. This speeds up DSE substantially. llvm-svn: 15204
* Add some comments to the backtracking code.Alkis Evlogimenos2004-07-251-2/+17
| | | | llvm-svn: 15200
* Free instructions kill values too. This implements DeadStoreElim/free.llxChris Lattner2004-07-251-4/+13
| | | | llvm-svn: 15199
* Add support for free instructionsChris Lattner2004-07-251-2/+18
| | | | llvm-svn: 15197
* Fix the sense of joinableChris Lattner2004-07-252-5/+5
| | | | llvm-svn: 15196
* Remove linux/solaris specific stuff.Chris Lattner2004-07-251-1/+3
| | | | llvm-svn: 15195
* This patch makes use of the infrastructure implemented before to safely andChris Lattner2004-07-251-1/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | aggressively coallesce live ranges even if they overlap. Consider this LLVM code for example: int %test(int %X) { %Y = mul int %X, 1 ;; Codegens to Y = X %Z = add int %X, %Y ret int %Z } The mul is just there to get a copy into the code stream. This produces this machine code: (0x869e5a8, LLVM BB @0x869b9a0): %reg1024 = mov <fi#-2>, 1, %NOREG, 0 ;; "X" %reg1025 = mov %reg1024 ;; "Y" (subsumed by X) %reg1026 = add %reg1024, %reg1025 %EAX = mov %reg1026 ret Note that the life times of reg1024 and reg1025 overlap, even though they contain the same value. This results in this machine code: test: mov %EAX, DWORD PTR [%ESP + 4] mov %ECX, %EAX add %EAX, %ECX ret Another, worse case involves loops and PHI nodes. Consider this trivial loop: testcase: int %test2(int %X) { entry: br label %Loop Loop: %Y = phi int [%X, %entry], [%Z, %Loop] %Z = add int %Y, 1 %cond = seteq int %Z, 100 br bool %cond, label %Out, label %Loop Out: ret int %Z } Because of interactions between the PHI elimination pass and the register allocator, this got compiled to this code: test2: mov %ECX, DWORD PTR [%ESP + 4] .LBBtest2_1: *** mov %EAX, %ECX inc %EAX cmp %EAX, 100 *** mov %ECX, %EAX jne .LBBtest2_1 ret Or on powerpc, this code: _test2: mflr r0 stw r0, 8(r1) stwu r1, -60(r1) .LBB_test2_1: addi r2, r3, 1 cmpwi cr0, r2, 100 *** or r3, r2, r2 bne cr0, .LBB_test2_1 *** or r3, r2, r2 lwz r0, 68(r1) mtlr r0 addi r1, r1, 60 blr 0 With this improvement in place, we now generate this code for these two testcases, which is what we want: test: mov %EAX, DWORD PTR [%ESP + 4] add %EAX, %EAX ret test2: mov %EAX, DWORD PTR [%ESP + 4] .LBBtest2_1: inc %EAX cmp %EAX, 100 jne .LBBtest2_1 # Loop ret Or on PPC: _test2: mflr r0 stw r0, 8(r1) stwu r1, -60(r1) .LBB_test2_1: addi r3, r3, 1 cmpwi cr0, r3, 100 bne cr0, .LBB_test2_1 lwz r0, 68(r1) mtlr r0 addi r1, r1, 60 blr 0 Static numbers for spill code loads/stores/reg-reg copies (smaller is better): em3d: before: 47/25/26 after: 44/22/24 164.gzip: before: 433/245/310 after: 403/231/278 175.vpr: before: 3721/2189/1581 after: 4144/2081/1423 176.gcc: before: 26195/8866/9235 after: 25942/8082/8275 186.crafty: before: 4295/2587/3079 after: 4119/2519/2916 252.eon: before: 12754/7585/5803 after: 12508/7425/5643 256.bzip2: before: 463/226/315 after: 482:241/309 Runtime perf number samples on X86: gzip: before: 41.09 after: 39.86 bzip2: runtime: before: 56.71s after: 57.07s gcc: before: 6.16 after: 6.12 eon: before: 2.03s after: 2.00s llvm-svn: 15194
* Make a method const, no functionality changesChris Lattner2004-07-252-6/+6
| | | | llvm-svn: 15193
* I think that V8 should coallesce registers, don't you?Chris Lattner2004-07-252-0/+25
| | | | llvm-svn: 15192
* Use name.empty() instead of testing against equality with the emptyAlkis Evlogimenos2004-07-251-1/+1
| | | | | | string. llvm-svn: 15191
* Disallow creation of named values of type void.Alkis Evlogimenos2004-07-251-0/+2
| | | | llvm-svn: 15190
* Fix a bug where we incorrectly value numbered the first PHI definition theChris Lattner2004-07-251-3/+26
| | | | | | | | same as the PHI use. This is not correct as the PHI use value is different depending on which branch is taken. This fixes espresso with aggressive coallescing, and perhaps others. llvm-svn: 15189
* Fix a bug in the range removerChris Lattner2004-07-251-1/+1
| | | | llvm-svn: 15188
* Add debugging output for joining assignmentsChris Lattner2004-07-251-0/+5
| | | | llvm-svn: 15187
OpenPOWER on IntegriCloud