summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
Commit message (Collapse)AuthorAgeFilesLines
* rename Type::isIntegral to Type::isInteger, eliminating the old Type::isInteger.Chris Lattner2007-01-151-3/+3
| | | | | | | | | rename Type::getIntegralTypeMask to Type::getIntegerTypeMask. This makes naming much more consistent. For example, there are now no longer any instances of IntegerType that are not considered isInteger! :) llvm-svn: 33225
* Eliminate calls to isInteger, generalizing code and tightening checks as needed.Chris Lattner2007-01-151-3/+3
| | | | llvm-svn: 33218
* simplify some codeChris Lattner2007-01-121-8/+2
| | | | llvm-svn: 33150
* For PR1064:Reid Spencer2007-01-121-5/+15
| | | | | | | | | | | | | | | | | | | | | | | Implement the arbitrary bit-width integer feature. The feature allows integers of any bitwidth (up to 64) to be defined instead of just 1, 8, 16, 32, and 64 bit integers. This change does several things: 1. Introduces a new Derived Type, IntegerType, to represent the number of bits in an integer. The Type classes SubclassData field is used to store the number of bits. This allows 2^23 bits in an integer type. 2. Removes the five integer Type::TypeID values for the 1, 8, 16, 32 and 64-bit integers. These are replaced with just IntegerType which is not a primitive any more. 3. Adjust the rest of LLVM to account for this change. Note that while this incremental change lays the foundation for arbitrary bit-width integers, LLVM has not yet been converted to actually deal with them in any significant way. Most optimization passes, for example, will still only deal with the byte-width integer types. Future increments will rectify this situation. llvm-svn: 33113
* Comparison of primitive type sizes should now be done in bits, not bytes.Reid Spencer2007-01-081-2/+3
| | | | | | | This patch converts getPrimitiveSize to getPrimitiveSizeInBits where it is appropriate to do so (comparison of integer primitive types). llvm-svn: 33012
* add -debug output for -indvars.Chris Lattner2007-01-071-6/+19
| | | | llvm-svn: 32971
* For PR950:Reid Spencer2006-12-311-3/+2
| | | | | | | | | | | | | This patch replaces signed integer types with signless ones: 1. [US]Byte -> Int8 2. [U]Short -> Int16 3. [U]Int -> Int32 4. [U]Long -> Int64. 5. Removal of isSigned, isUnsigned, getSignedVersion, getUnsignedVersion and other methods related to signedness. In a few places this warranted identifying the signedness information from other sources. llvm-svn: 32785
* For PR950:Reid Spencer2006-12-231-5/+5
| | | | | | | | This patch removes the SetCC instructions and replaces them with the ICmp and FCmp instructions. The SetCondInst instruction has been removed and been replaced with ICmpInst and FCmpInst. llvm-svn: 32751
* Switch over Transforms/Scalar to use the STATISTIC macro. For each statisticChris Lattner2006-12-191-6/+7
| | | | | | | converted, we lose a static initializer. This also allows GCC to emit warnings about unused statistics. llvm-svn: 32690
* Detemplatize the Statistic class. The only type it is instantiated withChris Lattner2006-12-061-5/+5
| | | | | | is 'unsigned'. llvm-svn: 32279
* For PR950:Reid Spencer2006-11-271-3/+2
| | | | | | | | | | The long awaited CAST patch. This introduces 12 new instructions into LLVM to replace the cast instruction. Corresponding changes throughout LLVM are provided. This passes llvm-test, llvm/test, and SPEC CPUINT2000 with the exception of 175.vpr which fails only on a slight floating point output difference. llvm-svn: 31931
* Fix Transforms/IndVarsSimplify/2006-09-20-LFTR-Crash.llChris Lattner2006-09-211-15/+22
| | | | llvm-svn: 30555
* eliminate RegisterOpt. It does the same thing as RegisterPass.Chris Lattner2006-08-271-1/+1
| | | | llvm-svn: 29925
* Add an assertion to check that we're really preserving LCSSA.Owen Anderson2006-08-251-0/+2
| | | | llvm-svn: 29886
* Reapply the indvars patch, since nothing blew up last night.Owen Anderson2006-08-251-0/+1
| | | | llvm-svn: 29874
* Revert my previous patch. Since there are some major changes that went in ↵Owen Anderson2006-08-251-3/+0
| | | | | | | | | today, I'm going to wait to put this in HEAD until tomorrow, so as not to clutter the nightly tester. llvm-svn: 29868
* Specify that indvars actually preserve LCSSA. This has been done for a ↵Owen Anderson2006-08-251-0/+3
| | | | | | | | while, but I forgot to put in the analysis usage. llvm-svn: 29867
* Fix a grammaro in a comment.Reid Spencer2006-08-181-1/+1
| | | | llvm-svn: 29765
* Hopefully the final attempt at making IndVars preserve LCSSA.Owen Anderson2006-07-141-2/+30
| | | | | | This should fix PR 831. llvm-svn: 29141
* Revert this patch temporarily until PR831 is fixed.Chris Lattner2006-07-131-31/+15
| | | | llvm-svn: 29134
* IndVars now (correctly) preserves LCSSA form.Owen Anderson2006-07-121-15/+31
| | | | llvm-svn: 29126
* Revert my indvars changes because they were breaking things. Unfortunately thisOwen Anderson2006-07-111-29/+15
| | | | | | didn't start showing up until after the recent instcombine fixes. llvm-svn: 29102
* De-pessimize the handling of LCSSA Phi nodes in IndVarSimplify. Hopefully thisOwen Anderson2006-06-271-15/+29
| | | | | | will make Shootout-C/nestedloop faster. llvm-svn: 28924
* Fix IndVarsSimplify/2006-06-16-Indvar-LCSSA-Crash.ll, a case where aChris Lattner2006-06-171-4/+19
| | | | | | | | "LCSSA" phi node causes indvars to break dominance properties. This fixes causes indvars to avoid inserting aggressive code in this case, instead indvars should be fixed to be more aggressive in the face of lcssa phi's. llvm-svn: 28850
* 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
* Allow indvar simplify to canonicalize ANY affine IV, not just affine IVs withChris Lattner2005-08-101-8/+8
| | | | | | constant stride. This implements Transforms/IndVarsSimplify/variable-stride-ivs.ll llvm-svn: 22744
* Break SCEVExpander out of IndVarSimplify into its own .h/.cpp file so thatNate Begeman2005-07-301-238/+1
| | | | | | other passes may use it. llvm-svn: 22557
* Fix PR582. The rewriter can move casts around, which invalidated theChris Lattner2005-06-151-1/+11
| | | | | | BB iterator. This fixes Transforms/IndVarsSimplify/2005-06-15-InstMoveCrash.ll llvm-svn: 22221
* Remove trailing whitespaceMisha Brukman2005-04-211-13/+13
| | | | llvm-svn: 21427
* Fix the second bug attached to PR504.Chris Lattner2005-02-141-1/+1
| | | | llvm-svn: 20181
* Fix for testcase Transforms/IndVarsSimplify/2005-02-11-InvokeCrash.llChris Lattner2005-02-121-0/+2
| | | | | | and PR504. llvm-svn: 20129
* Convert 'struct' to 'class' in various places to adhere to the coding standardsChris Lattner2004-10-271-1/+1
| | | | | | and work better with VC++. Patch contributed by Morten Ofstad! llvm-svn: 17281
* Fix a REALLY obscure bug in my previous checkin, which was splicing the ENDChris Lattner2004-10-121-1/+1
| | | | | | marker from one ilist into the middle of another basic block! llvm-svn: 16925
* Handle a common case more carefully. In particular, instead of transformingChris Lattner2004-10-111-4/+33
| | | | | | | | | | | | | | | | | pointer recurrences into expressions from this: %P_addr.0.i.0 = phi sbyte* [ getelementptr ([8 x sbyte]* %.str_1, int 0, int 0), %entry ], [ %inc.0.i, %no_exit.i ] %inc.0.i = getelementptr sbyte* %P_addr.0.i.0, int 1 ; <sbyte*> [#uses=2] into this: %inc.0.i = getelementptr sbyte* getelementptr ([8 x sbyte]* %.str_1, int 0, int 0), int %inc.0.i.rec Actually create something nice, like this: %inc.0.i = getelementptr [8 x sbyte]* %.str_1, int 0, int %inc.0.i.rec llvm-svn: 16924
* Prototype these functions more accuratelyChris Lattner2004-09-201-1/+1
| | | | llvm-svn: 16432
* Convert code to compile with vc7.1.Reid Spencer2004-09-151-4/+6
| | | | | | Patch contributed by Paolo Invernizzi. Thanks Paolo! llvm-svn: 16368
* Changes For Bug 352Reid Spencer2004-09-011-2/+2
| | | | | | | | Move include/Config and include/Support into include/llvm/Config, include/llvm/ADT and include/llvm/Support. From here on out, all LLVM public header files must be under include/llvm/. llvm-svn: 16137
* Throttle back indvar substitution from creating multiplies in loops. This ↵Chris Lattner2004-07-261-3/+3
| | | | | | is bad bad bad. llvm-svn: 15227
* Two fixes. First, stop using the ugly shouldSubstituteIndVar method.Chris Lattner2004-06-241-1/+7
| | | | | | | Second, disable substitution of quadratic addrec expressions to avoid putting multiplies in loops! llvm-svn: 14358
* Make use of BinaryOperator::create* methods to shrinkify code.Chris Lattner2004-06-201-21/+14
| | | | llvm-svn: 14262
* Fix a nasty bug, noticed by ReidChris Lattner2004-06-191-1/+1
| | | | llvm-svn: 14249
* Move the scev expansion code into this pass, where it belongs. There isChris Lattner2004-04-231-12/+252
| | | | | | | still room for cleanup, but at least the code modification is out of the analysis now. llvm-svn: 13135
* Disable a previous patch that was causing indvars to loop infinitely :(Chris Lattner2004-04-221-0/+2
| | | | llvm-svn: 13108
* Fix an extremely serious thinko I made in revision 1.60 of this file.Chris Lattner2004-04-221-16/+25
| | | | llvm-svn: 13106
* Implement a todo, rewriting all possible scev expressions inside of theChris Lattner2004-04-211-8/+18
| | | | | | | | loop. This eliminates the extra add from the previous case, but it's not clear that this will be a performance win overall. Tommorows test results will tell. :) llvm-svn: 13103
* Implement a fixme. The helps loops that have induction variables of differentChris Lattner2004-04-211-17/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | types in them. Instead of creating an induction variable for all types, it creates a single induction variable and casts to the other sizes. This generates this code: no_exit: ; preds = %entry, %no_exit %indvar = phi uint [ %indvar.next, %no_exit ], [ 0, %entry ] ; <uint> [#uses=4] *** %j.0.0 = cast uint %indvar to short ; <short> [#uses=1] %indvar = cast uint %indvar to int ; <int> [#uses=1] %tmp.7 = getelementptr short* %P, uint %indvar ; <short*> [#uses=1] store short %j.0.0, short* %tmp.7 %inc.0 = add int %indvar, 1 ; <int> [#uses=2] %tmp.2 = setlt int %inc.0, %N ; <bool> [#uses=1] %indvar.next = add uint %indvar, 1 ; <uint> [#uses=1] br bool %tmp.2, label %no_exit, label %loopexit instead of: no_exit: ; preds = %entry, %no_exit %indvar = phi ushort [ %indvar.next, %no_exit ], [ 0, %entry ] ; <ushort> [#uses=2] *** %indvar = phi uint [ %indvar.next, %no_exit ], [ 0, %entry ] ; <uint> [#uses=3] %indvar = cast uint %indvar to int ; <int> [#uses=1] %indvar = cast ushort %indvar to short ; <short> [#uses=1] %tmp.7 = getelementptr short* %P, uint %indvar ; <short*> [#uses=1] store short %indvar, short* %tmp.7 %inc.0 = add int %indvar, 1 ; <int> [#uses=2] %tmp.2 = setlt int %inc.0, %N ; <bool> [#uses=1] %indvar.next = add uint %indvar, 1 *** %indvar.next = add ushort %indvar, 1 br bool %tmp.2, label %no_exit, label %loopexit This is an improvement in register pressure, but probably doesn't happen that often. The more important fix will be to get rid of the redundant add. llvm-svn: 13101
* Change the ExitBlocks list from being explicitly contained in the LoopChris Lattner2004-04-181-4/+8
| | | | | | | structure to being dynamically computed on demand. This makes updating loop information MUCH easier. llvm-svn: 13045
* If the loop executes a constant number of times, try a bit harder to replaceChris Lattner2004-04-171-2/+5
| | | | | | exit values. llvm-svn: 13018
* Even if there are not any induction variables in the loop, if we can computeChris Lattner2004-04-171-1/+11
| | | | | | | the trip count for the loop, insert one so that we can canonicalize the exit condition. llvm-svn: 13015
OpenPOWER on IntegriCloud