summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
Commit message (Collapse)AuthorAgeFilesLines
* For PR1043:Reid Spencer2007-01-191-1/+2
| | | | | | | | | | | | | | This is the final patch for this PR. It implements some minor cleanup in the use of IntegerType, to wit: 1. Type::getIntegerTypeMask -> IntegerType::getBitMask 2. Type::Int*Ty changed to IntegerType* from Type* 3. ConstantInt::getType() returns IntegerType* now, not Type* This also fixes PR1120. Patch by Sheng Zhou. llvm-svn: 33370
* fix a bug in a recent patchChris Lattner2007-01-131-1/+1
| | | | llvm-svn: 33164
* Implement review feedback for the ConstantBool->ConstantInt merge. ChrisReid Spencer2007-01-121-6/+7
| | | | | | | | recommended that getBoolValue be replaced with getZExtValue and that get(bool) be replaced by get(const Type*, uint64_t). This implements those changes. llvm-svn: 33110
* Rename BoolTy as Int1Ty. Patch by Sheng Zhou.Reid Spencer2007-01-111-6/+6
| | | | llvm-svn: 33076
* For PR1043:Zhou Sheng2007-01-111-30/+34
| | | | | | | Merge ConstantIntegral and ConstantBool into ConstantInt. Remove ConstantIntegral and ConstantBool from LLVM. llvm-svn: 33073
* For PR950:Reid Spencer2006-12-231-4/+3
| | | | | | | | 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-7/+6
| | | | | | | 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
* Removed #include <iostream> and replaced with llvm_* streams.Bill Wendling2006-11-261-18/+17
| | | | llvm-svn: 31923
* For PR786:Reid Spencer2006-11-021-5/+2
| | | | | | | | | | Turn on -Wunused and -Wno-unused-parameter. Clean up most of the resulting fall out by removing unused variables. Remaining warnings have to do with unused functions (I didn't want to delete code without review) and unused variables in generated code. Maintainers should clean up the remaining issues when they see them. All changes pass DejaGnu tests and Olden. llvm-svn: 31380
* Eliminate ConstantBool::True and ConstantBool::False. Instead, provideChris Lattner2006-09-281-9/+10
| | | | | | ConstantBool::getTrue() and ConstantBool::getFalse(). llvm-svn: 30665
* Do not rely on std::sort and std::erase to get list of uniqueDevang Patel2006-08-291-10/+4
| | | | | | | | exit blocks. The output is dependent on addresses of basic block. Add and use Loop::getUniqueExitBlocks. llvm-svn: 29966
* eliminate RegisterOpt. It does the same thing as RegisterPass.Chris Lattner2006-08-271-1/+1
| | | | llvm-svn: 29925
* Fix a error that hadn't yet cause any problems, but I'm sure it would haveOwen Anderson2006-07-191-1/+1
| | | | | | somewhere down the road. llvm-svn: 29197
* Switch to a very conservative heuristic for determining when loop-unswitchingOwen Anderson2006-06-281-5/+5
| | | | | | | | | | will be profitable. This is mainly to remove some cases where excessive unswitching would result in long compile times and/or huge generated code. Once someone comes up with a better heuristic that avoids these cases, this should be switched out. llvm-svn: 28962
* Don't unswitch really large loops even if they are mostly filled with emptyChris Lattner2006-06-281-0/+6
| | | | | | blocks. llvm-svn: 28959
* Fix for 2006-06-27-DeadSwitchCase.llOwen Anderson2006-06-271-5/+6
| | | | | | | Be more careful when updating Phi nodes after eliminating dead switch cases. Fix proposed by Chris. llvm-svn: 28947
* Make LoopUnswitch able to unswitch loops with live-out values by taking ↵Owen Anderson2006-06-261-53/+63
| | | | | | | | | advantage of LCSSA. This results several times the number of unswitchings occurring on tests such and timberwolfmc, unix-tbl, and ldecod. llvm-svn: 28912
* Fix Transforms/LoopUnswitch/2006-06-13-SingleEntryPHI.ll, a loop unswitchChris Lattner2006-06-141-1/+13
| | | | | | bug exposed by the recent lcssa work. llvm-svn: 28779
* Reapply my 6/9 changes. The bug Evan saw no longer occurs.Owen Anderson2006-06-121-1/+7
| | | | llvm-svn: 28759
* Back out Owen's 6/9 changes. They broke ↵Evan Cheng2006-06-111-4/+0
| | | | | | MultiSource/Benchmarks/Prolangs-C/bison (and perhaps others). llvm-svn: 28747
* Add LCSSA as a requirement for LoopUnswitch, and assert that LoopUnswitch ↵Owen Anderson2006-06-091-0/+4
| | | | | | | | preserves LCSSA. llvm-svn: 28739
* add the actual cost to the debug infoChris Lattner2006-03-241-2/+4
| | | | llvm-svn: 27051
* Fix Regression/Transforms/LoopUnswitch/2006-02-22-UnswitchCrash.ll, whichChris Lattner2006-02-221-1/+3
| | | | | | | | | caused SPASS to fail building last night. We can't trivially unswitch a loop if the exit block has phi nodes in it, because we don't know which predecessor to use. llvm-svn: 26320
* Add some comments, simplify some code, and fix a bug that caused rewritingChris Lattner2006-02-221-34/+26
| | | | | | to rewrite with the wrong value. llvm-svn: 26311
* improved support for branch folding, still not enabled.Chris Lattner2006-02-181-143/+269
| | | | llvm-svn: 26289
* Implement deletion of dead blocks, currently disabled.Chris Lattner2006-02-181-28/+75
| | | | llvm-svn: 26285
* a previous patch completely disabled trivial unswitching, this fixees it.Chris Lattner2006-02-181-1/+0
| | | | | | Thanks to nate for pointing this out :) llvm-svn: 26280
* initial trivial support for folding branches that have now-constant ↵Chris Lattner2006-02-181-3/+34
| | | | | | destinations. llvm-svn: 26279
* When unswitching a loop, make sure to update loop info with exit blocks inChris Lattner2006-02-181-2/+4
| | | | | | the right loop. llvm-svn: 26277
* Fix loops where the header has an exit, fixing a loop-unswitch crash on craftyChris Lattner2006-02-171-13/+15
| | | | llvm-svn: 26258
* start of some new simplification code, not thoroughly tested, use at your ownChris Lattner2006-02-171-14/+161
| | | | | | risk :) llvm-svn: 26248
* Change SplitBlock to increment a BasicBlock::iterator, not an Instruction*. ↵Chris Lattner2006-02-161-23/+27
| | | | | | | | | | | Apparently they do different things :) This fixes a testcase that nate reduced from spass. Also included are a couple minor code changes that don't affect the generated code at all. llvm-svn: 26235
* Fix VC++ warning.Jeff Cohen2006-02-161-1/+0
| | | | llvm-svn: 26228
* fix a bug where we unswitched the wrong wayChris Lattner2006-02-161-2/+2
| | | | llvm-svn: 26225
* Implement trivial unswitching for switch stmts. This allows us to trivialChris Lattner2006-02-151-27/+51
| | | | | | | | | | | | | | | | | | unswitch this loop on 2 before sweating to unswitch on 1/3. void test4(int N, int i, int C, int*P, int*Q) { int j; for (j = 0; j < N; ++j) { switch (C) { // general unswitching. default: P[i+j] = 0; break; case 1: Q[i+j] = 0; break; case 3: P[i+j] = Q[i+j]; break; case 2: break; // TRIVIAL UNSWITCH on C==2 } } } llvm-svn: 26223
* make "trivial" unswitching significantly more general. It can now handleChris Lattner2006-02-151-47/+79
| | | | | | | | | | | | | this for example: for (j = 0; j < N; ++j) { // trivial unswitch if (C) P[i+j] = 0; } turning it into the obvious code without bothering to duplicate an empty loop. llvm-svn: 26220
* Checking the wrong value. This caused us to emit silly code likeChris Lattner2006-02-151-1/+1
| | | | | | | Y = seteq bool X, true instead of just using X :) llvm-svn: 26215
* more refactoring, no functionality change.Chris Lattner2006-02-151-12/+11
| | | | llvm-svn: 26194
* pull some code out into a functionChris Lattner2006-02-151-18/+28
| | | | llvm-svn: 26191
* Use statistics to keep track of what flavors of loops we are unswitchingChris Lattner2006-02-141-7/+19
| | | | llvm-svn: 26157
* implement unswitching of loops with switch stmts and selects in themChris Lattner2006-02-111-94/+135
| | | | llvm-svn: 26114
* Update PHI nodes in successors of exit blocks.Chris Lattner2006-02-101-5/+34
| | | | llvm-svn: 26113
* Reform the unswitching code in terms of edge splitting, not block splitting.Chris Lattner2006-02-101-49/+67
| | | | llvm-svn: 26112
* Fix a case where UnswitchTrivialCondition broke critical edges withChris Lattner2006-02-101-1/+24
| | | | | | phi's in the successors llvm-svn: 26108
* add some notes, move some code around. Implement unswitching of loopsChris Lattner2006-02-101-19/+64
| | | | | | with branches on partially invariant computations. llvm-svn: 26104
* Move code around to be more logical, no functionality change.Chris Lattner2006-02-101-26/+32
| | | | llvm-svn: 26103
* 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
OpenPOWER on IntegriCloud