summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar
Commit message (Collapse)AuthorAgeFilesLines
* Fix Regression/Transforms/ScalarRepl/2006-01-24-IllegalUnionPromoteCrash.llChris Lattner2006-01-241-3/+1
| | | | llvm-svn: 25587
* Make iostream #inclusion explicitChris Lattner2006-01-2212-1/+12
| | | | llvm-svn: 25514
* 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
* Lowerpacked and SCCP support for the insertelement operation.Robert Bocchino2006-01-172-8/+66
| | | | llvm-svn: 25406
* 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
* FunctionPass's cannot do IPO things.Chris Lattner2006-01-141-4/+0
| | | | llvm-svn: 25315
* Added instcombine support for extractelement.Robert Bocchino2006-01-131-1/+54
| | | | llvm-svn: 25299
* 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
* Switch these to using ETForest instead of DominatorSet to compute itself.Chris Lattner2006-01-112-10/+11
| | | | | | Patch written by Daniel Berlin! llvm-svn: 25202
* Switch this to using ETForest instead of DominatorSet to compute itself.Chris Lattner2006-01-111-16/+16
| | | | | | Patch written by Daniel Berlin! llvm-svn: 25201
* Added lower packed support for the extractelement operation.Robert Bocchino2006-01-102-0/+43
| | | | llvm-svn: 25180
* fix some 176.gcc miscompilation from my previous patch.Chris Lattner2006-01-071-7/+33
| | | | llvm-svn: 25137
* silence some bogus gcc warnings on fenrisChris Lattner2006-01-061-10/+11
| | | | llvm-svn: 25130
* Enhance the shift-shift folding code to allow a no-op cast to occur in betweenChris Lattner2006-01-061-55/+88
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the shifts. This allows us to fold this (which is the 'integer add a constant' sequence from cozmic's scheme compmiler): int %x(uint %anf-temporary776) { %anf-temporary777 = shr uint %anf-temporary776, ubyte 1 %anf-temporary800 = cast uint %anf-temporary777 to int %anf-temporary804 = shl int %anf-temporary800, ubyte 1 %anf-temporary805 = add int %anf-temporary804, -2 %anf-temporary806 = or int %anf-temporary805, 1 ret int %anf-temporary806 } into this: int %x(uint %anf-temporary776) { %anf-temporary776 = cast uint %anf-temporary776 to int %anf-temporary776.mask1 = add int %anf-temporary776, -2 %anf-temporary805 = or int %anf-temporary776.mask1, 1 ret int %anf-temporary805 } note that instcombine already knew how to eliminate the AND that the two shifts fold into. This is tested by InstCombine/shift.ll:test26 -Chris llvm-svn: 25128
* Simplify the code a bit moreChris Lattner2006-01-061-3/+5
| | | | llvm-svn: 25126
* Extract a bunch of code out of visitShiftInst into FoldShiftByConstant. NoChris Lattner2006-01-061-180/+189
| | | | | | functionality changes. llvm-svn: 25125
* getting there...Duraid Madina2005-12-261-0/+1
| | | | llvm-svn: 25021
* Fix Transforms/ScalarRepl/2005-12-14-UnionPromoteCrash.ll, a crash on undefinedChris Lattner2005-12-141-2/+2
| | | | | | behavior in 126.gcc on big-endian systems. llvm-svn: 24708
* Implement a little hack for parity with GCC on crafty. This speeds upChris Lattner2005-12-121-2/+277
| | | | | | | | | | | | | | | | | | | | | | 186.crafty by about 16% (from 15.109s to 13.045s) on my system. This turns allocas with unions/casts into scalars. For example crafty has something like this: union doub { unsigned short i[4]; long long d; }; int f(long long a) { return ((union doub){.d=a}).i[1]; } Instead of generating loads and stores to an alloca, we now promote the whole thing to a scalar long value. This implements: Transforms/ScalarRepl/AggregatePromote.ll llvm-svn: 24667
* getRawValue zero extens for unsigned values, use getsextvalue so that weChris Lattner2005-12-051-3/+3
| | | | | | | know that small negative values fit into the immediate field of addressing modes. llvm-svn: 24608
* Fix a bug where we didn't realize that vaarg reads memory. This fixesChris Lattner2005-11-301-0/+7
| | | | | | Transforms/DeadStoreElimination/2005-11-30-vaarg.ll llvm-svn: 24545
* since reg2mem requires it, might as well mention that it preserves itAndrew Lenharth2005-11-251-0/+1
| | | | llvm-svn: 24491
* Reg2Mem is something a pass may depend on, so allow thatAndrew Lenharth2005-11-221-0/+1
| | | | llvm-svn: 24488
* turns out, demotion and invokes and critical edges don't mixAndrew Lenharth2005-11-221-0/+4
| | | | llvm-svn: 24487
* Fix a crash building 176.gcc due to my recent patch, which only fixedChris Lattner2005-11-181-1/+1
| | | | | | half the problem. llvm-svn: 24414
* This was checking the wrong GEP expression. Fixing this fixes a gccas crashChris Lattner2005-11-171-1/+1
| | | | | | compiling mysql reported by Ted Kremenek. llvm-svn: 24402
* the pain isn't gone unless the phinodes are spilled tooAndrew Lenharth2005-11-101-1/+2
| | | | llvm-svn: 24288
* this works with backedges to the existing entry block alot betterAndrew Lenharth2005-11-101-2/+3
| | | | llvm-svn: 24270
* The pass everyone has been waiting for!Andrew Lenharth2005-11-101-0/+79
| | | | | | | | Reg2Mem for fun you can opt -reg2mem -mem2reg llvm-svn: 24267
* Add support alignment of allocation instructions.Nate Begeman2005-11-053-15/+19
| | | | | | | | | Add support for specifying alignment and size of setjmp jmpbufs. No targets currently do anything with this information, nor is it presrved in the bytecode representation. That's coming up next. llvm-svn: 24196
* Implement Transforms/TailCallElim/return-undef.ll, a trivial caseChris Lattner2005-11-051-0/+1
| | | | | | that has been sitting in my inbox since May 18. :) llvm-svn: 24194
* Turn sdiv into udiv if both operands have a clear sign bit. This occursChris Lattner2005-11-051-0/+19
| | | | | | | | | | | | | | | | | a few times in crafty: OLD: %tmp.36 = div int %tmp.35, 8 ; <int> [#uses=1] NEW: %tmp.36 = div uint %tmp.35, 8 ; <uint> [#uses=0] OLD: %tmp.19 = div int %tmp.18, 8 ; <int> [#uses=1] NEW: %tmp.19 = div uint %tmp.18, 8 ; <uint> [#uses=0] OLD: %tmp.117 = div int %tmp.116, 8 ; <int> [#uses=1] NEW: %tmp.117 = div uint %tmp.116, 8 ; <uint> [#uses=0] OLD: %tmp.92 = div int %tmp.91, 8 ; <int> [#uses=1] NEW: %tmp.92 = div uint %tmp.91, 8 ; <uint> [#uses=0] Which all turn into shrs. llvm-svn: 24190
* Turn srem -> urem when neither input has their sign bit set. This triggersChris Lattner2005-11-051-1/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | 8 times in vortex, allowing the srems to be turned into shrs: OLD: %tmp.104 = rem int %tmp.5.i37, 16 ; <int> [#uses=1] NEW: %tmp.104 = rem uint %tmp.5.i37, 16 ; <uint> [#uses=0] OLD: %tmp.98 = rem int %tmp.5.i24, 16 ; <int> [#uses=1] NEW: %tmp.98 = rem uint %tmp.5.i24, 16 ; <uint> [#uses=0] OLD: %tmp.91 = rem int %tmp.5.i19, 8 ; <int> [#uses=1] NEW: %tmp.91 = rem uint %tmp.5.i19, 8 ; <uint> [#uses=0] OLD: %tmp.88 = rem int %tmp.5.i14, 8 ; <int> [#uses=1] NEW: %tmp.88 = rem uint %tmp.5.i14, 8 ; <uint> [#uses=0] OLD: %tmp.85 = rem int %tmp.5.i9, 1024 ; <int> [#uses=2] NEW: %tmp.85 = rem uint %tmp.5.i9, 1024 ; <uint> [#uses=0] OLD: %tmp.82 = rem int %tmp.5.i, 512 ; <int> [#uses=2] NEW: %tmp.82 = rem uint %tmp.5.i1, 512 ; <uint> [#uses=0] OLD: %tmp.48.i = rem int %tmp.5.i.i161, 4 ; <int> [#uses=1] NEW: %tmp.48.i = rem uint %tmp.5.i.i161, 4 ; <uint> [#uses=0] OLD: %tmp.20.i2 = rem int %tmp.5.i.i, 4 ; <int> [#uses=1] NEW: %tmp.20.i2 = rem uint %tmp.5.i.i, 4 ; <uint> [#uses=0] it also occurs 9 times in gcc, but with odd constant divisors (1009 and 61) so the payoff isn't as great. llvm-svn: 24189
* make this 64 bit clean, fixed test30 of ↵Andrew Lenharth2005-11-021-1/+1
| | | | | | /Regression/Transforms/InstCombine/add.ll llvm-svn: 24158
* Limit the search depth of MaskedValueIsZero to 6 instructions, to avoidChris Lattner2005-10-311-10/+14
| | | | | | | bad cases. This fixes Markus's second testcase in PR639, and should seal it for good. llvm-svn: 24123
* This pass is now obsolete since all targets have moved to the SelectionDAGChris Lattner2005-10-291-170/+0
| | | | | | infrastructure and the simple isels have been removed. llvm-svn: 24090
* Pull some code out into a function, give it the ability to see through +.Chris Lattner2005-10-291-24/+59
| | | | | | This allows us to turn code like malloc(4*x+4) -> malloc int, (x+1) llvm-svn: 24081
* Remove a special case, allowing the general case to handle it. No functionalityChris Lattner2005-10-291-49/+37
| | | | | | change. llvm-svn: 24076
* Fix a bit of backwards logic that broke exptree and smg2000Chris Lattner2005-10-281-1/+1
| | | | llvm-svn: 24056
* Do not sink any instruction with side effects, including vaarg. This fixesChris Lattner2005-10-271-4/+2
| | | | | | PR640 llvm-svn: 24046
* Fix typoChris Lattner2005-10-271-1/+1
| | | | llvm-svn: 24033
* Teach instcombine to promote stuff like (cast (malloc sbyte, 8*X) to int*)Chris Lattner2005-10-271-7/+26
| | | | | | into: malloc int, (2*X) llvm-svn: 24032
* Promote cases like cast (malloc sbyte, 100) to int* intoChris Lattner2005-10-271-1/+22
| | | | | | | (malloc [25 x int]) directly without having to convert to (malloc [100 x sbyte]) first. llvm-svn: 24031
* Minor change to this file to support obscure cases with constant array amountsChris Lattner2005-10-271-5/+16
| | | | llvm-svn: 24030
* fold nested and's early to avoid inefficiencies in MaskedValueIsZero. ThisChris Lattner2005-10-261-0/+9
| | | | | | fixes a very slow compile in PR639. llvm-svn: 24011
* Update Visual Studio projects to reflect moved file.Jeff Cohen2005-10-261-855/+0
| | | | llvm-svn: 23998
* Handle allocations that, even after removing dead uses, still have more thanChris Lattner2005-10-241-3/+15
| | | | | | | | | | | | | | one use (but one is a cast). This handles the very common case of: X = alloc [n x byte] Y = cast X to somethingbetter seteq X, null In order to avoid infinite looping when there are multiple casts, we only allow this if the xform is strictly increasing the alignment of the allocation. llvm-svn: 23961
* Fix a bug where we would 'promote' an allocation from one type to anotherChris Lattner2005-10-241-2/+6
| | | | | | | where the second has less alignment required. If we had explicit alignment support in the IR, we could handle this case, but we can't until we do. llvm-svn: 23960
OpenPOWER on IntegriCloud