summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
Commit message (Collapse)AuthorAgeFilesLines
...
* When unswitching a trivial loop, do admit we are doing it! :)Chris Lattner2006-02-101-0/+7
| | | | llvm-svn: 26102
* Implement unconditional unswitching of 'trivial' loops, those loops that containChris Lattner2006-02-101-18/+149
| | | | | | branches in their entry block that control whether or not the loop is a noop or not. llvm-svn: 26101
* Simplify control flow a bit, note that unswitch preserves canonical loop formChris Lattner2006-02-091-10/+12
| | | | llvm-svn: 26098
* Make the threshold a parameterChris Lattner2006-02-091-3/+7
| | | | llvm-svn: 26093
* Simplify the loop-unswitch pass, by not even trying to unswitch loops withChris Lattner2006-02-091-86/+74
| | | | | | | uses of loop values outside the loop. We need loop-closed SSA form to do this right, or to use SSA rewriting if we really care. llvm-svn: 26089
* Fix 80-column violationsChris Lattner2006-02-091-8/+9
| | | | llvm-svn: 26088
* Enhance MVIZ in three ways:Chris Lattner2006-02-091-55/+157
| | | | | | | | | | | 1. Teach it new tricks: in particular how to propagate through signed shr and sexts. 2. Teach it to return a bitset of known-1 and known-0 bits, instead of just zero. 3. Teach instcombine (AND X, C) to fold when we know all C bits of X. This implements Regression/Transforms/InstCombine/bittest.ll, and allows future things to be simplified. llvm-svn: 26087
* Simplify some code, reducing calls to MaskedValueIsZero. Implement a minorChris Lattner2006-02-081-16/+32
| | | | | | optimization where we reduce the number of bits in AND masks when possible. llvm-svn: 26056
* Use EraseInstFromFunction in a few cases to put the uses of the removedChris Lattner2006-02-081-15/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | instruction onto the worklist (in case they are now dead). Add a really trivial local DSE implementation to help out bitfield code. We now fold this: struct S { unsigned char a : 1, b : 1, c : 1, d : 2, e : 3; S(); }; S::S() : a(0), b(0), c(1), d(0), e(6) {} to this: void %_ZN1SC1Ev(%struct.S* %this) { entry: %tmp.1 = getelementptr %struct.S* %this, int 0, uint 0 store ubyte 38, ubyte* %tmp.1 ret void } much earlier (in gccas instead of only in gccld after DSE runs). llvm-svn: 26050
* Implement some more interesting select sccp cases. This implements:Chris Lattner2006-02-081-15/+35
| | | | | | test/Regression/Transforms/SCCP/select.ll llvm-svn: 26049
* Fix a problem in my patch yesterday, causing a miscompilation of 176.gccChris Lattner2006-02-081-2/+3
| | | | llvm-svn: 26045
* Fix Transforms/InstCombine/2006-02-07-SextZextCrash.llChris Lattner2006-02-071-3/+5
| | | | llvm-svn: 26040
* Generalize MaskedValueIsZero into a ComputeMaskedNonZeroBits function, whichChris Lattner2006-02-071-44/+53
| | | | | | | | is just as efficient as MVIZ and is also more general. Fix a few minor bugs introduced in recent patches llvm-svn: 26036
* Make MaskedValueIsZero take a uint64_t instead of a ConstantIntegral as aChris Lattner2006-02-071-69/+58
| | | | | | | | mask. This allows the code to be simpler and more efficient. Also, generalize some of the cases in MVIZ a bit, making it slightly more aggressive. llvm-svn: 26035
* Use Type::getIntegralTypeMask() to simplify some codeChris Lattner2006-02-071-15/+8
| | | | llvm-svn: 26034
* Implement the beginnings of a facility for simplifying expressions based onChris Lattner2006-02-071-3/+145
| | | | | | | 'demanded bits', inspired by Nate's work in the dag combiner. This isn't complete, but needs to unrelated instcombiner changes to continue. llvm-svn: 26033
* Turn A % (C << N), where C is 2^k, into A & ((C << N)-1) [urem only].Chris Lattner2006-02-051-0/+35
| | | | | | | | Turn A / (C1 << N), where C1 is "1<<C2" into A >> (N+C2) [udiv only]. Tested with: rem.ll:test5, div.ll:test10 llvm-svn: 26003
* Use SCEVExpander::InsertCastOfTo instead of our own code. This reducesChris Lattner2006-02-041-18/+1
| | | | | | #LLVM LOC, and auto-cse's cast instructions. llvm-svn: 25974
* Fix two significant bugs in LSR:Chris Lattner2006-02-041-14/+75
| | | | | | | | | | 1. When rewriting code in outer loops, sometimes we would insert code into inner loops that is invariant in that loop. 2. Notice that 4*(2+x) is 8+4*x and use that to simplify expressions. This is a performance neutral change. llvm-svn: 25964
* Improve compatibility with VC2005, patch by Morten Ofstad!Jeff Cohen2006-01-261-2/+4
| | | | llvm-svn: 25661
* teach the cloner to handle inline asmsChris Lattner2006-01-261-9/+1
| | | | llvm-svn: 25633
* Fix Regression/Transforms/ScalarRepl/2006-01-24-IllegalUnionPromoteCrash.llChris Lattner2006-01-241-3/+1
| | | | llvm-svn: 25587
* rename methodChris Lattner2006-01-241-1/+1
| | | | llvm-svn: 25572
* When cloning a module, clone the inline asm.Chris Lattner2006-01-231-0/+1
| | | | llvm-svn: 25559
* add a bunch more optimizations for unary double math functionsChris Lattner2006-01-231-18/+78
| | | | llvm-svn: 25530
* Refactor/genericize this, no functionality changeChris Lattner2006-01-231-16/+30
| | | | llvm-svn: 25525
* Make iostream #inclusion explicitChris Lattner2006-01-2219-2/+20
| | | | llvm-svn: 25514
* Make this more efficient in the following ways:Chris Lattner2006-01-221-22/+37
| | | | | | | | | 1. Do not statically construct a map when the program starts up, this is expensive and cannot be optimized. Instead, create a list. 2. Do not insert entries for all function in the module into a hashmap that lives the full life of the compiler. llvm-svn: 25512
* Add explicit #includes of <iostream>Chris Lattner2006-01-224-0/+4
| | | | llvm-svn: 25509
* Several non-functionality changing changes:Chris Lattner2006-01-221-311/+151
| | | | | | | | | 1. Use the varargs version of getOrInsertFunction to simplify code. 2. remove #include 3. Reduce the number of #ifdef's. 4. remove extraneous vertical whitespace. llvm-svn: 25508
* ConstantFoldLoadThroughGEPConstantExpr wasn't handling pointers toRobert Bocchino2006-01-191-9/+22
| | | | | | packed types correctly. llvm-svn: 25470
* For PR696:Reid Spencer2006-01-191-0/+9
| | | | | | | | Don't do floor->floorf conversion if floorf is not available. This checks the compiler's host, not its target, which is incorrect for cross-compilers Not sure that's important as we don't build many cross-compilers. llvm-svn: 25456
* Implement casts.ll:test26: a cast from float -> double -> integer, doesn'tChris Lattner2006-01-191-2/+11
| | | | | | need the float->double part. llvm-svn: 25452
* If not internalizing, don't mark llvm.global[cd]tors const, as a fix for aChris Lattner2006-01-191-2/+5
| | | | | | hypothetical future boog. llvm-svn: 25430
* Don't internalize llvm.global[cd]tor unless there are uses of it. ThisChris Lattner2006-01-191-3/+9
| | | | | | unbreaks front-ends that don't use __main (like the new CFE). llvm-svn: 25429
* Make sure that cloning a module clones its target triple and dependentChris Lattner2006-01-181-3/+7
| | | | | | library list as well. This should help bugpoint. llvm-svn: 25424
* Constant folding support for the insertelement operation.Robert Bocchino2006-01-171-0/+3
| | | | llvm-svn: 25407
* Lowerpacked and SCCP support for the insertelement operation.Robert Bocchino2006-01-172-8/+66
| | | | llvm-svn: 25406
* Clean up the FFS optimization code, and make it correctly create the appropriateChris Lattner2006-01-171-41/+43
| | | | | | | unsigned llvm.cttz.* intrinsic, fixing the 2005-05-11-Popcount-ffs-fls regression last night. llvm-svn: 25398
* For PR411:Reid Spencer2006-01-161-5/+16
| | | | | | | | | | | | | | | | This patch is an incremental step towards supporting a flat symbol table. It de-overloads the intrinsic functions by providing type-specific intrinsics and arranging for automatically upgrading from the old overloaded name to the new non-overloaded name. Specifically: llvm.isunordered -> llvm.isunordered.f32, llvm.isunordered.f64 llvm.sqrt -> llvm.sqrt.f32, llvm.sqrt.f64 llvm.ctpop -> llvm.ctpop.i8, llvm.ctpop.i16, llvm.ctpop.i32, llvm.ctpop.i64 llvm.ctlz -> llvm.ctlz.i8, llvm.ctlz.i16, llvm.ctlz.i32, llvm.ctlz.i64 llvm.cttz -> llvm.cttz.i8, llvm.cttz.i16, llvm.cttz.i32, llvm.cttz.i64 New code should not use the overloaded intrinsic names. Warnings will be emitted if they are used. llvm-svn: 25366
* fix a crash due to missing parensChris Lattner2006-01-161-1/+1
| | | | llvm-svn: 25363
* This pass has never worked correctly. Remove.Chris Lattner2006-01-161-629/+0
| | | | llvm-svn: 25349
* Let the inliner update the callgraph to reflect the changes it makes, insteadChris Lattner2006-01-141-12/+2
| | | | | | of doing it ourselves. This fixes Transforms/Inline/2006-01-14-CallGraphUpdate.ll llvm-svn: 25321
* Teach the inliner to update the CallGraph itself, and have it add edges toChris Lattner2006-01-141-4/+53
| | | | | | llvm.stacksave/restore when it inserts calls to them. llvm-svn: 25320
* FunctionPass's cannot do IPO things.Chris Lattner2006-01-141-4/+0
| | | | llvm-svn: 25315
* Add bswap intrinsics as documented in the Language ReferenceNate Begeman2006-01-141-0/+3
| | | | llvm-svn: 25309
* Added instcombine support for extractelement.Robert Bocchino2006-01-131-1/+54
| | | | llvm-svn: 25299
* it is ok to dce stacksave.Chris Lattner2006-01-131-0/+1
| | | | llvm-svn: 25295
* Do a simple instcombine xforms to delete llvm.stackrestore cases.Chris Lattner2006-01-131-0/+33
| | | | llvm-svn: 25294
* Simplify this a tiny bit by using the new IntrinsicInst functionality.Chris Lattner2006-01-131-7/+12
| | | | llvm-svn: 25292
OpenPOWER on IntegriCloud