summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix typo "infinte".Nick Lewycky2011-12-231-1/+2
| | | | llvm-svn: 147226
* Add the actual code for r147175.Chad Rosier2011-12-221-11/+82
| | | | llvm-svn: 147176
* Speculatively revert r146578 to determine if it is the cause of a number ofChad Rosier2011-12-221-82/+11
| | | | | | | | | | | performance regressions (both execution-time and compile-time) on our nightly testers. Original commit message: Fix for bug #11429: Wrong behaviour for switches. Small improvement for code size heuristics. llvm-svn: 147131
* Fix for bug #11429: Wrong behaviour for switches. Small improvement for code ↵Stepan Dyatkovskiy2011-12-141-11/+82
| | | | | | size heuristics. llvm-svn: 146578
* SplitBlockPredecessors uses ArrayRef instead of Data and Size.Jakub Staszak2011-12-091-2/+1
| | | | llvm-svn: 146277
* Propagate TargetLibraryInfo throughout ConstantFolding.cpp and Chad Rosier2011-12-011-1/+1
| | | | | | | InstructionSimplify.cpp. Other fixups as needed. Part of rdar://10500969 llvm-svn: 145559
* Potential bug in RewriteLoopBodyWithConditionConstant: use iterator should ↵Stepan Dyatkovskiy2011-11-291-1/+5
| | | | | | not be changed inside the uses enumeration loop. llvm-svn: 145432
* Stop emitting instructions with the name "tmp" they eat up memory and have ↵Benjamin Kramer2011-09-271-1/+1
| | | | | | | | to be uniqued, without any benefit. If someone prefers %tmp42 to %42, run instnamer. llvm-svn: 140634
* Split the landing pad basic block with the correct function. Also merge theBill Wendling2011-09-271-3/+23
| | | | | | | split landingpad instructions into a PHI node. PR11016 llvm-svn: 140592
* Reinstate r133513 (reverted in r133700) with an additional fix for aJay Foad2011-06-231-4/+4
| | | | | | -Wshorten-64-to-32 warning in Instructions.h. llvm-svn: 133708
* Revert r133513:Eric Christopher2011-06-231-4/+4
| | | | | | | | | "Reinstate r133435 and r133449 (reverted in r133499) now that the clang self-hosted build failure has been fixed (r133512)." Due to some additional warnings. llvm-svn: 133700
* Reinstate r133435 and r133449 (reverted in r133499) now that the clangJay Foad2011-06-211-4/+4
| | | | | | self-hosted build failure has been fixed (r133512). llvm-svn: 133513
* Revert r133435 and r133449 to appease buildbots.Chad Rosier2011-06-211-4/+4
| | | | llvm-svn: 133499
* Change how PHINodes store their operands.Jay Foad2011-06-201-4/+4
| | | | | | | | | | | | | | | | | | | Change PHINodes to store simple pointers to their incoming basic blocks, instead of full-blown Uses. Note that this loses an optimization in SplitCriticalEdge(), because we can no longer walk the use list of a BasicBlock to find phi nodes. See the comment I removed starting "However, the foreach loop is slow for blocks with lots of predecessors". Extend replaceAllUsesWith() on a BasicBlock to also update any phi nodes in the block's successors. This mimics what would have happened when PHINodes were proper Users of their incoming blocks. (Note that this only works if OldBB->replaceAllUsesWith(NewBB) is called when OldBB still has a terminator instruction, so it still has some successors.) llvm-svn: 133435
* Bail on unswitching a switch statement for a case with a critical edge. We nameNick Lewycky2011-06-031-1/+5
| | | | | | | which edge to split by pred/succ pair, which means that we can end up splitting the wrong edge (by case value) in the switch statement entirely. Fixes PR10031! llvm-svn: 132535
* Simplify r132022 based on Cameron's feedback.Evan Cheng2011-05-251-12/+5
| | | | llvm-svn: 132071
* Forgot dyn_cast check.Evan Cheng2011-05-241-4/+4
| | | | llvm-svn: 132025
* Fix LoopUnswitch bug. RewriteLoopBodyWithConditionConstant can delete a deadEvan Cheng2011-05-241-13/+34
| | | | | | | | | | | case of a switch instruction. Back off this optimization when this would eliminate all of the predecessors to the latch. Sorry, I am unable to reduce a reasonably sized test case. rdar://9486843 llvm-svn: 132022
* Make LoopUnswitch preserve ScalarEvolution by just forgetting everything aboutCameron Zwarich2011-02-111-0/+5
| | | | | | | a loop when unswitching it. It only does this in the complex case, because everything should be fine already in the simple case. llvm-svn: 125369
* Revamp the ValueMapper interfaces in a couple ways:Chris Lattner2011-01-081-14/+1
| | | | | | | | | | | | | | | | 1. Take a flags argument instead of a bool. This makes it more clear to the reader what it is used for. 2. Add a flag that says that "remapping a value not in the map is ok". 3. Reimplement MapValue to share a bunch of code and be a lot more efficient. For lookup failures, don't drop null values into the map. 4. Using the new flag a bunch of code can vaporize in LinkModules and LoopUnswitch, kill it. No functionality change. llvm-svn: 123058
* Constant folding here is pointless, because InstructionSimplifyDuncan Sands2010-11-231-8/+1
| | | | | | | (which does constant folding and more) is called a few lines later. llvm-svn: 120042
* Factor code for testing whether replacing one value with anotherDuncan Sands2010-11-181-6/+7
| | | | | | | | preserves LCSSA form out of ScalarEvolution and into the LoopInfo class. Use it to check that SimplifyInstruction simplifications are not breaking LCSSA form. Fixes PR8622. llvm-svn: 119727
* If dom tree information is available, make it possible to passDuncan Sands2010-11-141-1/+1
| | | | | | it to get better phi node simplification. llvm-svn: 119055
* Passes do not need to recursively initialize passes that they preserve, ifOwen Anderson2010-10-191-1/+0
| | | | | | | they do not also require them. This allows us to reduce inter-pass linkage dependencies. llvm-svn: 116854
* Get rid of static constructors for pass registration. Instead, every pass ↵Owen Anderson2010-10-191-1/+3
| | | | | | | | | | | | | | | | | exposes an initializeMyPassFunction(), which must be called in the pass's constructor. This function uses static dependency declarations to recursively initialize the pass's dependencies. Clients that only create passes through the createFooPass() APIs will require no changes. Clients that want to use the CommandLine options for passes will need to manually call the appropriate initialization functions in PassInitialization.h before parsing commandline arguments. I have tested this with all standard configurations of clang and llvm-gcc on Darwin. It is possible that there are problems with the static dependencies that will only be visible with non-standard options. If you encounter any crash in pass registration/creation, please send the testcase to me directly. llvm-svn: 116820
* Be more consistent in using ValueToValueMapTy.Rafael Espindola2010-10-131-5/+5
| | | | llvm-svn: 116387
* Begin adding static dependence information to passes, which will allow us toOwen Anderson2010-10-121-1/+8
| | | | | | | | | perform initialization without static constructors AND without explicit initialization by the client. For the moment, passes are required to initialize both their (potential) dependencies and any passes they preserve. I hope to be able to relax the latter requirement in the future. llvm-svn: 116334
* Now with fewer extraneous semicolons!Owen Anderson2010-10-071-1/+1
| | | | llvm-svn: 115996
* Fix loop unswitching's assumption that a code path which eitherDan Gohman2010-09-011-9/+8
| | | | | | infinite loops or exits will eventually exit. This fixes PR5373. llvm-svn: 112745
* apparently unswitch had the same "Feature". Stop itsChris Lattner2010-08-291-7/+2
| | | | | | claims that it preserves domfrontier if it doesn't really. llvm-svn: 112445
* Reapply r110396, with fixes to appease the Linux buildbot gods.Owen Anderson2010-08-061-1/+1
| | | | llvm-svn: 110460
* Revert r110396 to fix buildbots.Owen Anderson2010-08-061-1/+1
| | | | llvm-svn: 110410
* Don't use PassInfo* as a type identifier for passes. Instead, use the ↵Owen Anderson2010-08-051-1/+1
| | | | | | | | address of the static ID member as the sole unique type identifier. Clean up APIs related to this change. llvm-svn: 110396
* Fix batch of converting RegisterPass<> to INTIALIZE_PASS().Owen Anderson2010-07-211-1/+1
| | | | llvm-svn: 109045
* Use ValueMap instead of DenseMap.Devang Patel2010-06-241-13/+13
| | | | | | The ValueMapper used by various cloning utility maps MDNodes also. llvm-svn: 106706
* Pulled CodeMetrics out of InlineCost.h and made it a bit more general, so it ↵Kenneth Uildriks2010-06-091-1/+1
| | | | | | can be reused from PartialSpecializationCost llvm-svn: 105725
* remove a bunch of ad-hoc code to simplify instructions fromChris Lattner2010-04-201-43/+12
| | | | | | | loop unswitch, and use inst simplify instead. It is more powerful and less duplication. llvm-svn: 101874
* RewriteLoopBodyWithConditionConstant can end up rewriting theChris Lattner2010-04-201-5/+14
| | | | | | | | condition we're unswitching on. In this case, don't try to simplify the second copy of the loop which may be dead or not, but is probably a constant now. This fixes PR6879 llvm-svn: 101870
* some code cleanups, use SwitchInst::findCaseValue, reduce indentationChris Lattner2010-04-051-62/+63
| | | | llvm-svn: 100468
* Code clean up.Evan Cheng2010-04-051-8/+8
| | | | llvm-svn: 100467
* Code refactoring.Evan Cheng2010-04-031-35/+33
| | | | llvm-svn: 100262
* Add a DominatorTree argument to isLCSSA so that it doesn't have toDan Gohman2010-03-101-1/+1
| | | | | | | compute a set of reachable blocks for itself each time it is called, which is fairly frequently. llvm-svn: 98179
* There are two ways of checking for a given type, for example isa<PointerType>(T)Duncan Sands2010-02-161-1/+1
| | | | | | | and T->isPointerTy(). Convert most instances of the first form to the second form. Requested by Chris. llvm-svn: 96344
* Uniformize the names of type predicates: rather than having isFloatTy andDuncan Sands2010-02-151-5/+5
| | | | | | isInteger, we now have isFloatTy and isIntegerTy. Requested by Chris! llvm-svn: 96223
* fix a crash in loop unswitch on a loop invariant vector condition.Chris Lattner2010-02-021-1/+5
| | | | llvm-svn: 95055
* Convert a ton of simple integer type equality tests to the new predicate.Benjamin Kramer2010-01-051-5/+5
| | | | llvm-svn: 92760
* Change errs() to dbgs().David Greene2010-01-051-8/+8
| | | | llvm-svn: 92608
* Add Loop contains utility methods for testing whether a loopDan Gohman2009-12-181-2/+2
| | | | | | | | contains another loop, or an instruction. The loop form is substantially more efficient on large loops than the typical code it replaces. llvm-svn: 91654
* Dereference loopHeader after checking for null rather than before.Dan Gohman2009-12-091-1/+2
| | | | llvm-svn: 90990
* Reverting patch in revision 89758, initial attempt at fixing PR5373 has ↵Edward O'Callaghan2009-11-251-0/+1
| | | | | | proven to be bogus. llvm-svn: 89844
OpenPOWER on IntegriCloud