aboutsummaryrefslogtreecommitdiffstats
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* Rearrange code a bitChris Lattner2004-02-241-30/+27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11793 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement: test/Regression/Transforms/SimplifyCFG/switch_create.llChris Lattner2004-02-241-7/+140
| | | | | | | | | | | This turns code like this: if (X == 4 | X == 7) and if (X != 4 & X != 7) into switch instructions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11792 91177308-0d34-0410-b5e6-96231b3b80d8
* Make enum private as it is an implementation detail.Alkis Evlogimenos2004-02-231-5/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11782 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove '4Virt' from member function names as it is obvious.Alkis Evlogimenos2004-02-232-15/+15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11781 91177308-0d34-0410-b5e6-96231b3b80d8
* Refactor VirtRegMap out of RegAllocLinearScan as the first part of bugAlkis Evlogimenos2004-02-233-136/+195
| | | | | | | 251 (providing a generic machine code rewriter/spiller). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11780 91177308-0d34-0410-b5e6-96231b3b80d8
* Include Config/config.h for SHLIBEXT.Alkis Evlogimenos2004-02-231-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11779 91177308-0d34-0410-b5e6-96231b3b80d8
* Generate much more efficient code in programs like pifftChris Lattner2004-02-231-0/+8
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11775 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a small typeo in my checkin last night that broke vortex and other ↵Chris Lattner2004-02-231-1/+1
| | | | | | programs :( git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11774 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix InstCombine/2004-02-23-ShiftShiftOverflow.llChris Lattner2004-02-231-3/+10
| | | | | | | Also, turn 'shr int %X, 1234' into 'shr int %X, 31' git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11768 91177308-0d34-0410-b5e6-96231b3b80d8
* Add number of spilled registers statistic.Alkis Evlogimenos2004-02-231-0/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11759 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix bugs in finegrainificationChris Lattner2004-02-231-1/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11758 91177308-0d34-0410-b5e6-96231b3b80d8
* Finegrainify namespacificationChris Lattner2004-02-234-22/+12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11757 91177308-0d34-0410-b5e6-96231b3b80d8
* Use MachineBasicBlock::getParent().Alkis Evlogimenos2004-02-231-2/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11756 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove implementation of default constructor as it is useless now.Alkis Evlogimenos2004-02-231-5/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11755 91177308-0d34-0410-b5e6-96231b3b80d8
* Refactor rewinding code for finding the first terminator of a basicAlkis Evlogimenos2004-02-235-33/+16
| | | | | | | | | | | | | block into MachineBasicBlock::getFirstTerminator(). This also fixes a bug in the implementation of the above in both RegAllocLocal and InstrSched, where instructions where added after the terminator if the basic block's only instruction was a terminator (it shouldn't matter for RegAllocLocal since this case never occurs in practice). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11748 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify code a bit, don't go off the end of the block, now that the currentChris Lattner2004-02-232-22/+18
| | | | | | | block we are in might be empty git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11744 91177308-0d34-0410-b5e6-96231b3b80d8
* We were forgetting to add FP_REG_KILL instructions to basic blocks which willChris Lattner2004-02-232-30/+54
| | | | | | | eventually get an assignment due to elimination of PHIs. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11743 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement cast.ll::test14/15Chris Lattner2004-02-231-0/+37
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11742 91177308-0d34-0410-b5e6-96231b3b80d8
* Refactor some code. In the mul - setcc folding case, we really care aboutChris Lattner2004-02-231-32/+63
| | | | | | | whether this is the sign bit or not, so check unsigned comparisons as well. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11740 91177308-0d34-0410-b5e6-96231b3b80d8
* Improved PhysRegTracker interface. RegAlloc lazily allocates the register ↵Alkis Evlogimenos2004-02-232-23/+21
| | | | | | tracker using a std::auto_ptr git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11738 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement mul.ll:test11Chris Lattner2004-02-231-6/+7
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11737 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement "strength reduction" of X <= C and X >= CChris Lattner2004-02-231-0/+9
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11735 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement InstCombine/mul.ll:test10, which is a case that occurs when dealingChris Lattner2004-02-231-0/+40
| | | | | | | with "predication" git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11734 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify iterator usage now that we have next(). Also don't pass iterators ↵Alkis Evlogimenos2004-02-231-11/+7
| | | | | | by reference now that MachineInstr* are in an ilist git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11732 91177308-0d34-0410-b5e6-96231b3b80d8
* Work around a gas bug. Print '-9223372036854775808' as unsigned.Chris Lattner2004-02-232-2/+8
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11729 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement cast fp -> boolChris Lattner2004-02-232-4/+8
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11728 91177308-0d34-0410-b5e6-96231b3b80d8
* Stop passing iterators around by reference now that we have ilists!Chris Lattner2004-02-232-48/+108
| | | | | | | Implement cast Type::ULongTy -> double git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11726 91177308-0d34-0410-b5e6-96231b3b80d8
* Some code cleanups from ChrisAlkis Evlogimenos2004-02-231-9/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11724 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix comments in PhysRegTracker and rename isPhysRegAvail to isRegAvail to be ↵Alkis Evlogimenos2004-02-232-5/+6
| | | | | | consistent with the other two git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11723 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a new cmove instructionChris Lattner2004-02-231-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11722 91177308-0d34-0410-b5e6-96231b3b80d8
* Move LiveIntervals.h up to be the first included headerAlkis Evlogimenos2004-02-231-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11721 91177308-0d34-0410-b5e6-96231b3b80d8
* Pull PhysRegTracker out of RegAllocLinearScan as it can be used by other ↵Alkis Evlogimenos2004-02-232-59/+92
| | | | | | allocators as well git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11720 91177308-0d34-0410-b5e6-96231b3b80d8
* Move LiveIntervals.h to lib/CodeGen since it shouldn't be exposed to other ↵Alkis Evlogimenos2004-02-232-2/+4
| | | | | | parts of the compiler git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11719 91177308-0d34-0410-b5e6-96231b3b80d8
* Only insert FP_REG_KILL instructions in MachineBasicBlocks that actuallyChris Lattner2004-02-222-96/+196
| | | | | | | | | | | | | | | | | use FP instructions. This reduces the number of instructions inserted in 176.gcc (for example) from 58074 to 101 (it doesn't use much FP, which is typical). This reduction speeds up the entire code generator. In the case of 176.gcc, llc went from taking 31.38s to 24.78s. The passes that sped up the most are the register allocator and the 2 live variable analysis passes, which sped up 2.3, 1.3, and 1.5s respectively. The asmprinter pass also sped up because it doesn't print the instructions in comments :) Note that this patch is likely to expose latent bugs in machine code passes, because now basicblock can be empty, where they were never empty before. I cleaned out regalloclocal, but who knows about linscan :) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11717 91177308-0d34-0410-b5e6-96231b3b80d8
* Another bug fix for empty MBB'sChris Lattner2004-02-221-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11716 91177308-0d34-0410-b5e6-96231b3b80d8
* Move MOTy::UseType enum into MachineOperand. This eliminates theAlkis Evlogimenos2004-02-2210-67/+82
| | | | | | | | | | switch statements in the constructors and simplifies the implementation of the getUseType() member function. You will have to specify defs using MachineOperand::Def instead of MOTy::Def though (similarly for Use and UseAndDef). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11715 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a bug where we were implicitly assuming that there would be at leastChris Lattner2004-02-221-2/+2
| | | | | | | one terminator instruction in each basic block. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11714 91177308-0d34-0410-b5e6-96231b3b80d8
* Reduce the number of pointless copies inserted due to constant pointer refs.Chris Lattner2004-02-222-12/+24
| | | | | | | Also, make an assertion actually fireable! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11713 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix bug in previous checkout: leave the iterator at the first instructionChris Lattner2004-02-222-8/+6
| | | | | | | AFTER the GEP that was emitted. :( git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11712 91177308-0d34-0410-b5e6-96231b3b80d8
* Completely rewrite how getelementptr instructions are expanded. This has twoChris Lattner2004-02-222-84/+140
| | | | | | | | | | | | | | | (minor) benefits right now: 1. An extra dummy MOVrr32 is gone. This move would often be coallesced by both allocators anyway. 2. The code now uses the gep_type_iterator to walk the gep, which should future proof it a bit. It still assumes that array indexes are Longs though. These don't really justify rewriting the code. The big benefit will come later though. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11710 91177308-0d34-0410-b5e6-96231b3b80d8
* When folding memory operands in machine instructions be careful toAlkis Evlogimenos2004-02-221-2/+4
| | | | | | | | leave register operands with the same use/def flags as the original instruction. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11709 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a soon-to-be-missing #includeChris Lattner2004-02-221-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11707 91177308-0d34-0410-b5e6-96231b3b80d8
* Get all instruction definitionsChris Lattner2004-02-221-3/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11706 91177308-0d34-0410-b5e6-96231b3b80d8
* Wow this is out of date. When we have _real_ code generator documentation,Chris Lattner2004-02-221-42/+31
| | | | | | | this should be folded into it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11705 91177308-0d34-0410-b5e6-96231b3b80d8
* Print basic block boundaries in machine instruction debug output.Alkis Evlogimenos2004-02-222-4/+8
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11704 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement Transforms/InstCombine/cast.ll:test13, a case which occurs in aChris Lattner2004-02-222-4/+35
| | | | | | | hot 164.gzip loop. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11702 91177308-0d34-0410-b5e6-96231b3b80d8
* The two address pass cannot handle two addr instructions where one incomingChris Lattner2004-02-222-18/+32
| | | | | | | | | value is a physreg and one is a virtreg. For this reason, disable copy folding entirely for physregs. Also, use the new isMoveInstr target hook which gives us folding of FP moves as well. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11700 91177308-0d34-0410-b5e6-96231b3b80d8
* Abstract merging of ranges away from number of slots per instruction.Alkis Evlogimenos2004-02-222-4/+11
| | | | | | | | Also make it less aggressive as the current implementation breaks in some cases. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11696 91177308-0d34-0410-b5e6-96231b3b80d8
* Use isNull instead of getNode() to test for existence of a node, this is ↵Chris Lattner2004-02-221-6/+11
| | | | | | | | | | cheaper. FIX MAJOR BUG, whereby we didn't merge null edges correctly. Correcting this fixes poolallocation on 175.vpr, and possibly others. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11695 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix an iterator invalidation problem which was causing some nodes to not beChris Lattner2004-02-211-20/+19
| | | | | | | correctly merged over! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11693 91177308-0d34-0410-b5e6-96231b3b80d8